Dashboard: Display the comment counts in `wp_dashboard_right_now()` in the rare initial condition when there are 0 approved comments and only pending comments, so the AJAX count update could work.

Props afercia.
Fixes #35519.
Built from https://develop.svn.wordpress.org/trunk@37335


git-svn-id: http://core.svn.wordpress.org/trunk@37301 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2016-05-01 11:06:28 +00:00
parent 49a47bb255
commit dc5815146e
2 changed files with 2 additions and 2 deletions

View File

@ -263,7 +263,7 @@ function wp_dashboard_right_now() {
} }
// Comments // Comments
$num_comm = wp_count_comments(); $num_comm = wp_count_comments();
if ( $num_comm && $num_comm->approved ) { if ( $num_comm && ( $num_comm->approved || $num_comm->moderated ) ) {
$text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) ); $text = sprintf( _n( '%s Comment', '%s Comments', $num_comm->approved ), number_format_i18n( $num_comm->approved ) );
?> ?>
<li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li> <li class="comment-count"><a href="edit-comments.php"><?php echo $text; ?></a></li>

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.6-alpha-37334'; $wp_version = '4.6-alpha-37335';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.