Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#18354 closed defect (bug) (duplicate)

hide_empty still retrieves terms with only trashed posts with get_terms()

Reported by: sarahG111 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.2.1
Component: Taxonomy Keywords:
Focuses: Cc:


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?

Change History (2)

#1 @solarissmoke
7 years ago

  • Keywords 2nd-opinion needs-patch removed
  • Resolution set to duplicate
  • Status changed from new to closed

#2 @SergeyBiryukov
7 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.