Opened 9 years ago
Last modified 7 years ago
#32993 accepted defect (bug)
get_terms with child_of only works with uninterrupted hierarchies
Reported by: | eclev91 | Owned by: | DrewAPicture |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.2.2 |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
Similar to #14477 -
If I use get_terms()
with both search and child_of, the filtered results are passed to _get_term_children()
, and if those results don't include an uninterrupted heirarchy, it returns an empty array. Something like...
get_terms(array( 'search'=>$search_term, 'child_of'=>6 ));
won't return grandchildren of 6 that match $search_term
.
Change History (4)
Note: See
TracTickets for help on using
tickets.
I have a workaround that just worked for me.
I had to delete an option from the DB before my
child_of
search worked.Option Name: {taxonomy_name}_children
delete_option( {taxonomy_name}_children )
Then my
child_of
search worked wonderfully as described.My situation:
child_of
wasn't working no matter what I did and did not describe in the args