[oik] plugins.com

WordPress plugins and themes

  • Home
  • About
    • lazy shortcodes
    • smart shortcodes
    • oik base plugin
      • oik – donate
      • oik PayPal buttons
      • oik installation
      • oik Button Shortcode button
      • oik changelog
      • oik FAQ
      • oik plugins on SVN
      • oik plugins on GitHub
  • Plugins
    • oik base plugin
    • FREE oik plugins
    • WordPress plugins
    • Premium oik plugins
    • Bespoke oik plugins
  • Shortcodes
    • Shortcode examples
  • Blocks
    • Block examples
  • APIs
    • ALL action and filter hooks
  • Blog

BW_List_Table::comments_bubble() – Display a comment count bubble

You appear to be a bot. Output may be restricted

Description

Display a comment count bubble

Usage

BW_List_Table::comments_bubble( $post_id, $pending_comments );

Parameters

$post_id
( int ) required – The post ID.
$pending_comments
( int ) required – Number of pending comments.

Returns

void

Source

File name: oik/admin/class-bw-list-table.php
Lines:
1 to 40 of 40
  protected function comments_bubble( $post_id, $pending_comments ) {
    $approved_comments = get_comments_number();

    $approved_comments_number = number_format_i18n( $approved_comments );
    $pending_comments_number = number_format_i18n( $pending_comments );

    /* translators: %s: Number of comments */
    $approved_only_phrase = sprintf( _n( '%s comment', '%s comments', $approved_comments ), $approved_comments_number );
        /* translators: %s: Number of approved comments */
    $approved_phrase = sprintf( _n( '%s approved comment', '%s approved comments', $approved_comments ), $approved_comments_number );
        /* translators: %s: Number of pending comments */
    $pending_phrase = sprintf( _n( '%s pending comment', '%s pending comments', $pending_comments ), $pending_comments_number );

    // No comments at all.
    if ( ! $approved_comments && ! $pending_comments ) {
      printf( '<span aria-hidden="true">&#8212;</span><span class="screen-reader-text">%s</span>',
        __( 'No comments' )
      );
    // Approved comments have different display depending on some conditions.
    } elseif ( $approved_comments ) {
      printf( '<a href="%s" class="post-com-count post-com-count-approved"><span class="comment-count-approved" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
        esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'approved' ), admin_url( 'edit-comments.php' ) ) ),
        $approved_comments_number,
        $pending_comments ? $approved_phrase : $approved_only_phrase
      );
    } else {
      printf( '<span class="post-com-count post-com-count-no-comments"><span class="comment-count comment-count-no-comments" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
        $approved_comments_number,
        $pending_comments ? __( 'No approved comments' ) : __( 'No comments' )
      );
    }

    if ( $pending_comments ) {
      printf( '<a href="%s" class="post-com-count post-com-count-pending"><span class="comment-count-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></a>',
        esc_url( add_query_arg( array( 'p' => $post_id, 'comment_status' => 'moderated' ), admin_url( 'edit-comments.php' ) ) ),
        $pending_comments_number,
        $pending_phrase
      );
    }
  }
 
 View on GitHub View on Trac

Published: February 2, 2018 | Last updated: February 2, 2018

Information

Function name: BW_List_Table::comments_bubble
Class ref: BW_List_Table
Plugin ref: oik – oik information kit
Version: 4.10.0
Sourcefile: admin/class-bw-list-table.php
File ref: admin/class-bw-list-table.php
Deprecated?: No
API Letters: B,C,L,T

Recent plugin updates

sb-breadcrumbs-block v0.6.1 Update to sb-breadcrumbs-block v0.6.1 for support for PHP 8.1 and PHP 8.2 ...
slog v1.5.1 Update to slog v1.5.1 for support for PHP 8.1 and PHP 8.2 ...
oik-presentation v2.0.1 Update to oik-presentation v2.0.1 for support for PHP 8.1 and PHP 8.2. ...
oik-video v1.2.4 Update to oik-video v1.2.4 for support for PHP 8.1 and PHP 8.2 ...
oik-tunes v1.0.0 Update to oik-tunes v1.0.0 for support for PHP 8.1 and PHP 8.2 ...

Plugins

  • All Plugins
  • oik base plugin
  • FREE oik plugins
  • WordPress plugins
  • Premium oik plugins

Themes

  • FREE themes
  • Bespoke themes
  • Premium themes

Blocks

  • All Blocks
  • Block examples
  • About Blocks

Shortcodes

  • All Shortcodes
  • Shortcode examples
  • About Shortcodes

Reference

  • About APIs
  • All APIs
  • All Classes
  • All Files
  • All Hooks

Support

  • Contact
  • Cookies policy
  • Get API key
  • Privacy
  • Request support
  • Sitemap
  • Stay informed
  • Terms and Conditions
oik-plugins
Email: herb@bobbingwide.com

Weight shipping plugins

Find out which cart weight shipping plugin you need for your WooCommerce site.
Which cart weight based plugin do I need?

Site:  www.oik-plugins.com
© Copyright oik-plugins 2011-2023. All rights reserved.


Website designed and developed by Herb Miller of Bobbing Wide
Proudly powered by WordPress and oik-plugins
WordPress 6.4.1. PHP: 7.4.33. Memory limit: 768M