Changeset 34127
- Timestamp:
- 09/14/2015 07:24:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r33810 r34127 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; … … 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 } … … 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 … … 549 562 */ 550 563 public function display_rows() { 551 global $post; 564 global $post, $wp_query; 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 ); 552 570 553 571 add_filter( 'the_title','esc_html' );
Note: See TracChangeset
for help on using the changeset viewer.