Make WordPress Core

Ticket #33414: 33414.diff

File 33414.diff, 969 bytes (added by Kau-Boy, 10 years ago)
  • src/wp-admin/edit-comments.php

    diff --git src/wp-admin/edit-comments.php src/wp-admin/edit-comments.php
    index ea5bb76..dea027b 100644
    $wp_list_table->prepare_items(); 
    104104wp_enqueue_script('admin-comments');
    105105enqueue_comment_hotkeys_js();
    106106
    107 if ( $post_id )
    108         $title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
    109 else
    110         $title = __('Comments');
     107if ( $post_id ) {
     108    $title = sprintf(__('Comments on “%s”'), wp_html_excerpt(_draft_or_post_title($post_id), 50, '…'));
     109} else {
     110    $comments_count = get_comment_count();
     111
     112    if (isset($comments_count['awaiting_moderation']) && $comments_count['awaiting_moderation'] > 0) {
     113        $title = sprintf( __('Comments (%s)' ), $comments_count['awaiting_moderation'] );
     114    } else {
     115        $title = __('Comments' );
     116    }
     117}
    111118
    112119add_screen_option( 'per_page' );
    113120