mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-02 03:34:33 +00:00
Comments: dynamically update the document title text of the Comments List Table page when dynamically updating the number of comments awaiting moderation.
Fixes #33414. git-svn-id: https://develop.svn.wordpress.org/trunk@33821 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -104,10 +104,29 @@ $wp_list_table->prepare_items();
|
||||
wp_enqueue_script('admin-comments');
|
||||
enqueue_comment_hotkeys_js();
|
||||
|
||||
if ( $post_id )
|
||||
$title = sprintf( __( 'Comments on “%s”' ), wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' ) );
|
||||
else
|
||||
$title = __('Comments');
|
||||
if ( $post_id ) {
|
||||
$comments_count = wp_count_comments( $post_id );
|
||||
$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
|
||||
if ( $comments_count->moderated > 0 ) {
|
||||
$title = sprintf(
|
||||
__( 'Comments (%s) on “%s”' ),
|
||||
number_format_i18n( $comments_count->moderated ),
|
||||
$draft_or_post_title
|
||||
);
|
||||
} else {
|
||||
$title = sprintf( __( 'Comments on “%s”' ), $draft_or_post_title );
|
||||
}
|
||||
} else {
|
||||
$comments_count = wp_count_comments();
|
||||
if ( $comments_count->moderated > 0 ) {
|
||||
$title = sprintf(
|
||||
__( 'Comments (%s)' ),
|
||||
number_format_i18n( $comments_count->moderated )
|
||||
);
|
||||
} else {
|
||||
$title = __( 'Comments' );
|
||||
}
|
||||
}
|
||||
|
||||
add_screen_option( 'per_page' );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user