get_terms : query by exact term_name, help needed
-
Hello All!
I cannot making it work.I have the following custom taxonomy structure (category like) :
A
\–My Sub Term Parent A
\–My Sub Term Parent AbisNow I want to get the FIRST sub-term object so I query like that:
$query_term = array( 'parent' => 804, // id of term "A" 'search' => esc_attr("My Sub Term Parent A") ); $cat_term_obj = get_terms($my_tax, $query_term);
The problem is it doesn’t allow me to retrieve the exact match of the queried term name. It retrieves nothing (null). I tried with name__like parameter but it’s the same.
Is there a way to retrieve a term in a custom taxonomy name, b ased on the exact term name ?
Thank you for your help,
Looic.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘get_terms : query by exact term_name, help needed’ is closed to new replies.