Ticket #29745: 29745-2.patch
File 29745-2.patch, 1.4 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/class-wp-terms-list-table.php
99 99 if ( !empty( $_REQUEST['order'] ) ) 100 100 $args['order'] = trim( wp_unslash( $_REQUEST['order'] ) ); 101 101 102 if ( !empty( $_REQUEST['post_type'] ) ) 103 $args['post_type'] = trim( wp_unslash( $_REQUEST['post_type'] ) ); 104 102 105 $this->callback_args = $args; 103 106 104 107 $this->set_pagination_args( array( … … 186 189 return; 187 190 } 188 191 192 // update counts if limited to post type by tax_querying for an accurate post count 193 if ( isset( $args['post_type'] ) && post_type_exists( $args['post_type'] ) ) { 194 foreach ( $terms as $term_key => $term ) { 195 $proper_term_count = new WP_Query( array( 196 'post_type' => $args['post_type'], 197 'posts_per_page' => 1, 198 'suppress_filters' => true, 199 'fields' => 'ids', 200 'tax_query' => array( 201 array( 202 'taxonomy' => $taxonomy, 203 'field' => 'slug', 204 'terms' => $term->slug, 205 ) 206 ) 207 ) ); 208 $terms[ $term_key ]->count = $proper_term_count->found_posts; 209 } 210 } 211 189 212 if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) { 190 213 if ( ! empty( $args['search'] ) ) {// Ignore children on searches. 191 214 $children = array();