How to make a wordpress search more friendly, this code does an excellent job if there is a $ _GET variable, but if it is missing, it simply returns array (0). How to make it so that the search is carried out only when there is a $ _GET variable?
$test = get_posts([ 'meta_query' => [ [ 'key' => 'Город', 'value' => $_GET['city'] ], [ 'key' => 'Область', 'value' => $_GET['address'] ], [ 'key' => 'Режим дня', 'value' => $_GET['rejim'] ] ]]);