X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/dc1231b7312fbdca99e9e887cc2bb35a28f85cdc..refs/tags/wordpress-4.4:/wp-admin/includes/class-wp-comments-list-table.php diff --git a/wp-admin/includes/class-wp-comments-list-table.php b/wp-admin/includes/class-wp-comments-list-table.php index fcfcd1e3..a7c6d869 100644 --- a/wp-admin/includes/class-wp-comments-list-table.php +++ b/wp-admin/includes/class-wp-comments-list-table.php @@ -1,19 +1,19 @@ 'comments', @@ -53,6 +54,12 @@ class WP_Comments_List_Table extends WP_List_Table { ) ); } + public function floated_admin_avatar( $name, $comment_ID ) { + $comment = get_comment( $comment_ID ); + $avatar = get_avatar( $comment, 32, 'mystery' ); + return "$avatar $name"; + } + /** * @return bool */ @@ -176,10 +183,11 @@ class WP_Comments_List_Table extends WP_List_Table { public function no_items() { global $comment_status; - if ( 'moderated' == $comment_status ) + if ( 'moderated' === $comment_status ) { _e( 'No comments awaiting moderation.' ); - else + } else { _e( 'No comments found.' ); + } } /** @@ -196,22 +204,51 @@ class WP_Comments_List_Table extends WP_List_Table { //, number_format_i18n($num_comments->moderated) ), "" . number_format_i18n($num_comments->moderated) . ""), //, number_format_i18n($num_comments->spam) ), "" . number_format_i18n($num_comments->spam) . "") $stati = array( - 'all' => _nx_noop('All', 'All', 'comments'), // singular not used - 'moderated' => _n_noop('Pending (%s)', 'Pending (%s)'), - 'approved' => _n_noop('Approved', 'Approved'), // singular not used - 'spam' => _n_noop('Spam (%s)', 'Spam (%s)'), - 'trash' => _n_noop('Trash (%s)', 'Trash (%s)') - ); + /* translators: %s: all comments count */ + 'all' => _nx_noop( + 'All (%s)', + 'All (%s)', + 'comments' + ), // singular not used + + /* translators: %s: pending comments count */ + 'moderated' => _nx_noop( + 'Pending (%s)', + 'Pending (%s)', + 'comments' + ), + + /* translators: %s: approved comments count */ + 'approved' => _nx_noop( + 'Approved (%s)', + 'Approved (%s)', + 'comments' + ), + + /* translators: %s: spam comments count */ + 'spam' => _nx_noop( + 'Spam (%s)', + 'Spam (%s)', + 'comments' + ), + + /* translators: %s: trashed comments count */ + 'trash' => _nx_noop( + 'Trash (%s)', + 'Trash (%s)', + 'comments' + ) + ); if ( !EMPTY_TRASH_DAYS ) unset($stati['trash']); - $link = 'edit-comments.php'; + $link = admin_url( 'edit-comments.php' ); if ( !empty($comment_type) && 'all' != $comment_type ) $link = add_query_arg( 'comment_type', $comment_type, $link ); foreach ( $stati as $status => $label ) { - $class = ( $status == $comment_status ) ? ' class="current"' : ''; + $class = ( $status === $comment_status ) ? ' class="current"' : ''; if ( !isset( $num_comments->$status ) ) $num_comments->$status = 10; @@ -223,9 +260,12 @@ class WP_Comments_List_Table extends WP_List_Table { if ( !empty( $_REQUEST['s'] ) ) $link = add_query_arg( 's', esc_attr( wp_unslash( $_REQUEST['s'] ) ), $link ); */ - $status_links[$status] = "" . sprintf( + $status_links[ $status ] = "" . sprintf( translate_nooped_plural( $label, $num_comments->$status ), - number_format_i18n( $num_comments->$status ) + sprintf( '%s', + ( 'moderated' === $status ) ? 'pending' : $status, + number_format_i18n( $num_comments->$status ) + ) ) . ''; } @@ -257,10 +297,11 @@ class WP_Comments_List_Table extends WP_List_Table { if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) $actions['spam'] = _x( 'Mark as Spam', 'comment' ); - if ( 'trash' == $comment_status ) + if ( 'trash' === $comment_status ) { $actions['untrash'] = __( 'Restore' ); - elseif ( 'spam' == $comment_status ) + } elseif ( 'spam' === $comment_status ) { $actions['unspam'] = _x( 'Not Spam', 'comment' ); + } if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || !EMPTY_TRASH_DAYS ) $actions['delete'] = __( 'Delete Permanently' ); @@ -282,7 +323,7 @@ class WP_Comments_List_Table extends WP_List_Table { ?>