[wp-trac] [WordPress Trac] #37728: hide_empty doesn't work correctly in get_terms when no taxonomy specified
WordPress Trac
noreply at wordpress.org
Tue Apr 30 02:37:30 UTC 2019
#37728: hide_empty doesn't work correctly in get_terms when no taxonomy specified
-------------------------------------------------+-------------------------
Reporter: smerriman | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Taxonomy | Version: 4.5
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
reporter-feedback close needs-testing |
-------------------------------------------------+-------------------------
Comment (by smerriman):
I'm getting exactly the same results now as 3 years ago by following the
steps mentioned in my original post:
- install a new version of WP
- create a category, and a subcategory
- create a post, and place it inside the subcategory only
Calling `get_terms()` will return the subcategory, but not the parent
category.
Calling `get_terms(array('taxonomy'=>'category'))` and
`get_terms(array('taxonomy'=>array('category','post_tag')))` both include
the parent category.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37728#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list