[wp-trac] [WordPress Trac] #15322: Skip category and tag queries on non posts in get_post_class()

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 5 12:23:09 UTC 2010


#15322: Skip category and tag queries on non posts in get_post_class()
--------------------------+-------------------------------------------------
 Reporter:  mfields       |       Owner:                        
     Type:  defect (bug)  |      Status:  new                   
 Priority:  normal        |   Milestone:  Awaiting Review       
Component:  Template      |     Version:  3.1                   
 Severity:  normal        |    Keywords:  dev-feedback has-patch
--------------------------+-------------------------------------------------
 Where post_class() is used in a loop that iterates over an array of non-
 post objects get_post_class() will query for categories and tags
 regardless. Most times, these taxonomies are not registered with the
 post_type. This bug results in 2 additional queries per iteration. Please
 see attached (post-class-test.php) for an example using attachments.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15322>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list