Skip to content

Instantly share code, notes, and snippets.

@JuliaKiselyova
Last active September 20, 2023 08:47
Show Gist options
  • Select an option

  • Save JuliaKiselyova/1f73ec21429d143e17b15fbb4f5de8ab to your computer and use it in GitHub Desktop.

Select an option

Save JuliaKiselyova/1f73ec21429d143e17b15fbb4f5de8ab to your computer and use it in GitHub Desktop.
<?php
add_filter('jet-smart-filters/query/final-query', function($query) {
if (($query['orderby'] ?? '') === 'meta_value_num' && ($query['meta_key'] ?? '') === 'psm') {
$query['meta_query'][] = array(
'key' => 'psm',
'value' => 0,
'compare' => '>',
'type' => 'NUMERIC',
);
$query['tax_query']['property-status'] = array(
'taxonomy' => 'property-status',
'field' => 'term_id',
'terms' => 7,
);
}
return $query;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment