[themify_is_logged_in]
[php]
function rlv_radius_search($query) {
get the lower and upper bound for latitude and longitude here and store them in variables
$meta_query = array(
‚relation‘ => ‚AND‘,
array(
‚key‘ => ‚latitude‘,
‚value‘ => array($latitude_lower_bound, $latitute_upper_bound),
‚type‘ => ’numeric‘,
‚compare‘ => ‚BETWEEN‘
),
array(
‚key‘ => ‚longitude‘,
‚value‘ => array($longitude_lower_bound, $longitute_upper_bound),
‚type‘ => ’numeric‘,
‚compare‘ => ‚BETWEEN‘
)
);
$query->set(‚meta_query‘, $meta_query);
return $query;
}
add_filter(‚relevanssi_modify_wp_query‘, ‚rlv_radius_search‘);
[/php]
[/themify_is_logged_in]