wp_count_terms() hide_empty not working
|Reported by:||zeo||Owned by:||markjaquith|
For tax category, wp_count_terms( 'category', array( 'hide_empty' => true ) ) returns all category and doesn't hide category with post count 0. Instead need to use wp_count_terms( 'category', array( 'hide_empty' => true, 'hierarchical' => false ) ).
Since hide_empty=false is the default args, wp_count_terms() should set hierarchical=false by default too.
Change History (16)
comment:1 @markjaquith — 5 years ago
- Milestone changed from Awaiting Review to 3.1
- Owner set to markjaquith
- Status changed from new to accepted
comment:4 @markjaquith — 5 years ago
- Keywords 3.2-early added
- Milestone changed from 3.1 to Future Release
- Priority changed from normal to high
- Severity changed from normal to major
- Keywords 3.7-early added
- Milestone changed from 3.6 to Future Release