[wp-trac] [WordPress Trac] #13670: Taxonomies for custom Post_Types do not recieve pad_counts treatment

WordPress Trac wp-trac at lists.automattic.com
Tue Jun 1 10:33:29 UTC 2010


#13670: Taxonomies for custom Post_Types do not recieve pad_counts treatment
--------------------------+-------------------------------------------------
 Reporter:  dd32          |       Owner:             
     Type:  defect (bug)  |      Status:  new        
 Priority:  normal        |   Milestone:  3.0        
Component:  Taxonomy      |     Version:  3.0        
 Severity:  normal        |    Keywords:  needs-patch
--------------------------+-------------------------------------------------

Comment(by reko):

 With this patch, _pad_term_counts() queries the post_type(s) of passed
 taxonomy instead of just post_type = 'post'.

 REPLACED
 wp-includes\taxonomy.php # 2387 with:

 $object_types = is_array(get_taxonomy($taxonomy)->object_type) ?
 get_taxonomy($taxonomy)->object_type :
 array(get_taxonomy($taxonomy)->object_type);
 $object_types = esc_sql($object_types);
 $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
 IN ('" . implode("', '", $object_types) . "') AND post_status =
 'publish'");

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13670#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list