I have this structure:
taxonomy - term1 -- child term1 -- child term2 -term2 -- child term1 -- child term2
I have two select boxes. First one shows the parent terms (term1 and term2) and the second one shows the childs of the selected parent.
I submit the form to "search-results.php". How can I get the values of both selects to create this kind of query?
$args = array( 'tax_query' => array( array( 'taxonomy' => 'state', 'field' => 'slug', 'terms' => array( term1, childTerm2 ), 'operator' => 'IN' ) ) );