Created
November 14, 2019 11:56
-
-
Save propertyhive/85d6b4dd2d790426e1166f1fa0543d1d to your computer and use it in GitHub Desktop.
Filter digital displays by for sale only
This file contains 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_digital_display_query_args', 'available_only_in_digital_displays', 10, 2 ); | |
function available_only_in_digital_displays($args, $digitaldisplay) | |
{ | |
if ( !isset($args) ) | |
{ | |
$args['tax_query'] = array(); | |
} | |
$args['tax_query'][] = array( | |
'taxonomy' => 'availability', | |
'field' => 'name', | |
'terms' => array( 'For Sale', 'To Let' ), | |
); | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment