get_terms with hide_empty returns count > 0 with unpublished items
|Reported by:||bendog||Owned by:|
|Cc:||scribu, neo@…, jgadbois, paudelvinay, wpcore@…|
I think that's a bug.
I've defined a custom post type and a custom category taxonomy for it.
On my front end, i'm using get_terms with hide_empty to show the categories of the existing custom post type.
get_terms does ignore unpublished posts but it seems to include trashed item.
I have one category that is linked to only a trashed item and the function includes it in the count.
I can't select 3.0.3 in the version dropdown but it happened on any 3.0.x that I tried.
Change History (10)
- Cc neo@… added
- Keywords changed from taxonomy, custom post to taxonomy custom post
- Summary changed from get_terms with hide_empty returns count > 0 with trashed items to get_terms with hide_empty returns count > 0 with unpublished items
comment:7 paudelvinay — 2 years ago
- Cc paudelvinay added
- Severity changed from minor to major
- Version changed from 3.0.2 to 3.2.1
comment:9 barrykooij — 9 months ago
- Cc wpcore@… added
- Resolution set to worksforme
- Status changed from new to closed