Ticket #29745: 29745.patch
File 29745.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 'nopaging' => true, 198 'fields' => 'ids', 199 'tax_query' => array( 200 array( 201 'taxonomy' => $taxonomy, 202 'field' => 'slug', 203 'terms' => $term->slug, 204 ) 205 ) 206 ) ); 207 $terms[ $term_key ]->count = count( $proper_term_count->posts ); 208 } 209 } 210 189 211 if ( is_taxonomy_hierarchical( $taxonomy ) && ! isset( $args['orderby'] ) ) { 190 212 if ( ! empty( $args['search'] ) ) {// Ignore children on searches. 191 213 $children = array();