I’ve been trying this for hours now and I have searched and haven’t gotten a clue. I am trying to make a nested query with OR
operator as a parent and AND
operator inside it as child. The page keeps on loading and results are not shown. While on the other hand, if I make AND
as parent then it works. Here is my code:
$compare_array = array(
'relation' => 'OR',
array(
'relation' => 'AND',
array(
'key' => 'property_size',
'value' => '15',
'type' => 'numeric',
'compare' => '='
),
array(
'key' => 'property-type',
'value' => 'marla',
'type' => 'CHAR',
'compare' => 'LIKE'
)
),
array(
'relation' => 'AND',
array(
'key' => 'property_size',
'value' => '15',
'type' => 'numeric',
'compare' => '='
),
array(
'key' => 'property-type',
'value' => 'Kanal',
'type' => 'CHAR',
'compare' => 'LIKE'
)
)
);
$meta_query[] = $compare_array;