[wp-trac] [WordPress Trac] #15806: get_terms with hide_empty returns count > 0 with unpublished items

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 15 20:57:52 UTC 2011


#15806: get_terms with hide_empty returns count > 0 with unpublished items
--------------------------+------------------------------
 Reporter:  bendog        |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Taxonomy      |     Version:  3.0.2
 Severity:  minor         |  Resolution:
 Keywords:  needs-patch   |
--------------------------+------------------------------
Changes (by jgadbois):

 * cc: jgadbois (added)


Comment:

 Seems like either a join will be needed in get_terms() or
 wp_update_term_count_now() will need to be modified to only count terms
 tied to published posts.  This second method will also require counts to
 be updated when post status changes.

 I'd be happy to look at this one...anyone want to chime in as to which
 approach would be preferred?

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


More information about the wp-trac mailing list