[wp-trac] [WordPress Trac] #18354: hide_empty still retrieves terms with only trashed posts with get_terms()

WordPress Trac wp-trac at lists.automattic.com
Mon Aug 8 15:32:07 UTC 2011


#18354: hide_empty still retrieves terms with only trashed posts with get_terms()
--------------------------+-------------------------------------
 Reporter:  sarahG111     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  3.2.1
 Severity:  normal        |   Keywords:  2nd-opinion needs-patch
--------------------------+-------------------------------------
 Using get_terms('taxonomy-slug', 'hide_empty=1'), I get a list of terms
 for live posts as well as terms with just trashed posts in.

 You can see this happening if you go to view a taxonomy admin page where
 all of the terms are listed. On the right it gives the post count, and
 this includes trashed posts. I don't know if this uses get_terms() but
 it's basically the same idea/issue.

 I'm not sure if this is expected behaviour but would assume that, despite
 the post still existing, if it's trashed then the term is essentially
 empty?

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


More information about the wp-trac mailing list