Opened 14 years ago
Closed 11 years ago
#16240 closed defect (bug) (invalid)
hide_empty doesn't work in get_terms() when hierarchical isn't set to false
Reported by: | markjaquith | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | major | Version: | |
Component: | Taxonomy | Keywords: | close |
Focuses: | Cc: |
Description
I end up with some 0-count categories when calling get_terms( 'category', array( 'hide_empty' => true ) )
I think it has to do with the child count logic.
Change History (4)
#2
@
12 years ago
With both hierarchical
and hide_empty
set to true, empty categories are only returned if they have non-empty children.
There's a block in get_terms()
for that (introduced in [4104]):
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/taxonomy.php#L1402
Note: See
TracTickets for help on using
tickets.
I can't reproduce the issue - any use cases?