Ticket #11381: 11381.2.diff
| File 11381.2.diff, 1.6 KB (added by , 10 years ago) |
|---|
-
src/wp-admin/includes/class-wp-media-list-table.php
8 8 * @access private 9 9 */ 10 10 class WP_Media_List_Table extends WP_List_Table { 11 /** 12 * Store the pending comment count for each post 13 * 14 * @access public 15 * @since 4.4.0 16 * @var array 17 */ 18 public $pending_count = array(); 11 19 12 20 private $detached; 13 21 … … 149 157 150 158 /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */ 151 159 do_action( 'restrict_manage_posts', $this->screen->post_type ); 152 160 153 161 submit_button( __( 'Filter' ), 'button', 'filter_action', false, array( 'id' => 'post-query-submit' ) ); 154 162 } 155 163 … … 481 489 public function column_comments( $post ) { 482 490 echo '<div class="post-com-count-wrapper">'; 483 491 484 $pending_comments = get_pending_comments_num( $post->ID ); 492 if ( isset( $this->pending_count[ $post->ID ] ) ) { 493 $pending_comments = $this->pending_count[ $post->ID ]; 494 } else { 495 $pending_comments = get_pending_comments_num( $post->ID ); 496 } 497 485 498 $this->comments_bubble( $post->ID, $pending_comments ); 486 499 487 500 echo '</div>'; … … 548 561 * @global WP_Post $post 549 562 */ 550 563 public function display_rows() { 551 global $post ;564 global $post, $wp_query; 552 565 566 $post_ids = wp_list_pluck( $wp_query->posts, 'ID' ); 567 reset( $wp_query->posts ); 568 569 $this->pending_count = get_pending_comments_num( $post_ids ); 570 553 571 add_filter( 'the_title','esc_html' ); 554 572 555 573 while ( have_posts() ) : the_post();