wp/wp-admin/edit-comments.php
changeset 19 3d72ae0968f4
parent 18 be944660c56a
child 21 48c4eec2b7e6
equal deleted inserted replaced
18:be944660c56a 19:3d72ae0968f4
   136 enqueue_comment_hotkeys_js();
   136 enqueue_comment_hotkeys_js();
   137 
   137 
   138 if ( $post_id ) {
   138 if ( $post_id ) {
   139 	$comments_count      = wp_count_comments( $post_id );
   139 	$comments_count      = wp_count_comments( $post_id );
   140 	$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
   140 	$draft_or_post_title = wp_html_excerpt( _draft_or_post_title( $post_id ), 50, '…' );
       
   141 
   141 	if ( $comments_count->moderated > 0 ) {
   142 	if ( $comments_count->moderated > 0 ) {
       
   143 		// Used in the HTML title tag.
   142 		$title = sprintf(
   144 		$title = sprintf(
   143 			/* translators: 1: Comments count, 2: Post title. */
   145 			/* translators: 1: Comments count, 2: Post title. */
   144 			__( 'Comments (%1$s) on “%2$s”' ),
   146 			__( 'Comments (%1$s) on “%2$s”' ),
   145 			number_format_i18n( $comments_count->moderated ),
   147 			number_format_i18n( $comments_count->moderated ),
   146 			$draft_or_post_title
   148 			$draft_or_post_title
   147 		);
   149 		);
   148 	} else {
   150 	} else {
       
   151 		// Used in the HTML title tag.
   149 		$title = sprintf(
   152 		$title = sprintf(
   150 			/* translators: %s: Post title. */
   153 			/* translators: %s: Post title. */
   151 			__( 'Comments on “%s”' ),
   154 			__( 'Comments on “%s”' ),
   152 			$draft_or_post_title
   155 			$draft_or_post_title
   153 		);
   156 		);
   154 	}
   157 	}
   155 } else {
   158 } else {
   156 	$comments_count = wp_count_comments();
   159 	$comments_count = wp_count_comments();
       
   160 
   157 	if ( $comments_count->moderated > 0 ) {
   161 	if ( $comments_count->moderated > 0 ) {
       
   162 		// Used in the HTML title tag.
   158 		$title = sprintf(
   163 		$title = sprintf(
   159 			/* translators: %s: Comments count. */
   164 			/* translators: %s: Comments count. */
   160 			__( 'Comments (%s)' ),
   165 			__( 'Comments (%s)' ),
   161 			number_format_i18n( $comments_count->moderated )
   166 			number_format_i18n( $comments_count->moderated )
   162 		);
   167 		);
   163 	} else {
   168 	} else {
       
   169 		// Used in the HTML title tag.
   164 		$title = __( 'Comments' );
   170 		$title = __( 'Comments' );
   165 	}
   171 	}
   166 }
   172 }
   167 
   173 
   168 add_screen_option( 'per_page' );
   174 add_screen_option( 'per_page' );
   243 if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
   249 if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
   244 	echo '<span class="subtitle">';
   250 	echo '<span class="subtitle">';
   245 	printf(
   251 	printf(
   246 		/* translators: %s: Search query. */
   252 		/* translators: %s: Search query. */
   247 		__( 'Search results for: %s' ),
   253 		__( 'Search results for: %s' ),
   248 		'<strong>' . wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '&hellip;' ) . '</strong>'
   254 		'<strong>' . esc_html( wp_unslash( $_REQUEST['s'] ) ) . '</strong>'
   249 	);
   255 	);
   250 	echo '</span>';
   256 	echo '</span>';
   251 }
   257 }
   252 ?>
   258 ?>
   253 
   259