Comments List Table: include count for "All". Dynamically update.

Fixes #17275.

Built from https://develop.svn.wordpress.org/trunk@34506


git-svn-id: http://core.svn.wordpress.org/trunk@34470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-24 17:57:25 +00:00
parent 41edf2bc22
commit 4671e03766
4 changed files with 44 additions and 35 deletions

View File

@ -204,40 +204,47 @@ class WP_Comments_List_Table extends WP_List_Table {
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
$stati = array(
'all' => _nx_noop( 'All', 'All', 'comments' ), // singular not used
'moderated' => str_replace( '%s', '<span class="pending-count">%s</span>',
/* translators: %s: pending comments count */
_nx_noop(
'Pending <span class="count">(%s)</span>',
'Pending <span class="count">(%s)</span>',
'comments'
)
),
'approved' => str_replace( '%s', '<span class="approved-count">%s</span>',
/* translators: %s: approved comments count */
_nx_noop(
'Approved <span class="count">(%s)</span>',
'Approved <span class="count">(%s)</span>',
'comments'
)
),
'spam' => str_replace( '%s', '<span class="spam-count">%s</span>',
/* translators: %s: spam comments count */
_nx_noop(
'Spam <span class="count">(%s)</span>',
'Spam <span class="count">(%s)</span>',
'comments'
)
),
'trash' => str_replace( '%s', '<span class="trash-count">%s</span>',
/* translators: %s: trashed comments count */
_nx_noop(
'Trash <span class="count">(%s)</span>',
'Trash <span class="count">(%s)</span>',
'comments'
)
'all' => str_replace( '%s', '<span class="all-count">%s</span>',
/* translators: %s: pending comments count */
_nx_noop(
'All <span class="count">(%s)</span>',
'All <span class="count">(%s)</span>',
'comments'
)
);
), // singular not used
'moderated' => str_replace( '%s', '<span class="pending-count">%s</span>',
/* translators: %s: pending comments count */
_nx_noop(
'Pending <span class="count">(%s)</span>',
'Pending <span class="count">(%s)</span>',
'comments'
)
),
'approved' => str_replace( '%s', '<span class="approved-count">%s</span>',
/* translators: %s: approved comments count */
_nx_noop(
'Approved <span class="count">(%s)</span>',
'Approved <span class="count">(%s)</span>',
'comments'
)
),
'spam' => str_replace( '%s', '<span class="spam-count">%s</span>',
/* translators: %s: spam comments count */
_nx_noop(
'Spam <span class="count">(%s)</span>',
'Spam <span class="count">(%s)</span>',
'comments'
)
),
'trash' => str_replace( '%s', '<span class="trash-count">%s</span>',
/* translators: %s: trashed comments count */
_nx_noop(
'Trash <span class="count">(%s)</span>',
'Trash <span class="count">(%s)</span>',
'comments'
)
)
);
if ( !EMPTY_TRASH_DAYS )
unset($stati['trash']);

View File

@ -435,10 +435,12 @@ setCommentsList = function() {
if ( pendingDiff ) {
updatePending( pendingDiff, commentPostId );
updateCountText( 'span.all-count', pendingDiff );
}
if ( approvedDiff ) {
updateApproved( approvedDiff, commentPostId );
updateCountText( 'span.all-count', approvedDiff );
}
if ( spamDiff ) {

File diff suppressed because one or more lines are too long

View File

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