Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created November 14, 2019 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save propertyhive/85d6b4dd2d790426e1166f1fa0543d1d to your computer and use it in GitHub Desktop.
Save propertyhive/85d6b4dd2d790426e1166f1fa0543d1d to your computer and use it in GitHub Desktop.
Filter digital displays by for sale only
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