Hi I'm currently trying to edit the relation of the City dropdown which you can find on this page to use the the OR logic like on the first field Region
I have attempted to change the AND to OR through the function.php file like below but this didn't work
function filter_florida_location() {
ob_start();
$tax_query = array('relation' => 'AND');
if (isset($_POST['region']) && !empty($_POST['region']))
{
$tax_query[] = array(
'taxonomy' => 'region',
'field' => 'term_id',
'terms' => $_POST['region'],
//'operator' => 'IN',
);
}
if (isset($_POST['city']) && !empty($_POST['city']))
{
foreach($_POST['city'] as $key => $val){
$tax_query[] = array('relation' => 'OR');
$tax_query[][] = array(
'taxonomy' => 'city',
'field' => 'term_id',
'terms' => array($val),
);
}
}
Thank you in advance!!