Created
April 10, 2025 09:51
-
-
Save propertyhive/59f7876e1cc9ed740636f9ef8ace2926 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'propertyhive_taxonomy_hide_empty_args', function( $args, $field, $term_id ) { | |
if ($field['type'] == 'location') | |
{ | |
// Make sure 'tax_query' exists | |
if ( !isset( $args['tax_query'] ) ) { | |
$args['tax_query'] = array(); | |
} | |
// Add condition to exclude properties where 'availability' taxonomy term is 'Sold' | |
$args['tax_query'][] = array( | |
'taxonomy' => 'availability', | |
'field' => 'slug', | |
'terms' => array( 'sold' ), | |
'operator' => 'NOT IN', | |
); | |
} | |
return $args; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment