Changeset 15108
- Timestamp:
- 06/02/2010 02:55:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/taxonomy.php
r15065 r15108 2376 2376 function _pad_term_counts(&$terms, $taxonomy) { 2377 2377 global $wpdb; 2378 2378 error_log("here $taxonomy"); 2379 2379 // This function only works for hierarchical taxonomies like post categories. 2380 2380 if ( !is_taxonomy_hierarchical( $taxonomy ) ) … … 2394 2394 2395 2395 // Get the object and term ids and stick them in a lookup table 2396 $results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (".join(',', array_keys($term_ids)).") AND post_type = 'post' AND post_status = 'publish'"); 2396 $tax_obj = get_taxonomy($taxonomy); 2397 $object_types = esc_sql($tax_obj->object_type); 2398 $results = $wpdb->get_results("SELECT object_id, term_taxonomy_id FROM $wpdb->term_relationships INNER JOIN $wpdb->posts ON object_id = ID WHERE term_taxonomy_id IN (" . implode(',', array_keys($term_ids)) . ") AND post_type IN ('" . implode("', '", $object_types) . "') AND post_status = 'publish'"); 2397 2399 foreach ( $results as $row ) { 2398 2400 $id = $term_ids[$row->term_taxonomy_id];
Note: See TracChangeset
for help on using the changeset viewer.