Opened 12 years ago
Closed 10 years ago
#15919 closed defect (bug) (fixed)
wp_count_terms() hide_empty not working
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.7 | Priority: | high |
Severity: | major | Version: | |
Component: | Taxonomy | Keywords: | has-patch 3.7-early |
Focuses: | Cc: |
Description
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.
Attachments (4)
Change History (16)
#1
@
12 years ago
- Milestone changed from Awaiting Review to 3.1
- Owner set to markjaquith
- Status changed from new to accepted
#4
@
12 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
This is not a regression from 3.0, so I'm going to do it 3.2-early.
#6
@
10 years ago
- Milestone changed from Future Release to 3.6
Refreshed against trunk just so the line numbers match - this is from the class of 3.2-early
#8
@
10 years ago
Generally, a refresh is only needed when the patch no longer applies cleanly.
Line numbers may be off, but as long as the content is the same, the patch should still apply cleanly. 15919.002.diff is still fine.
Also, when copying code directly from Trac, make sure to remove trailing whitespace.
Bug reproduced. Patch fixes it.