Skip to content

Instantly share code, notes, and snippets.

@propertyhive
Created January 15, 2026 16:13
Show Gist options
  • Select an option

  • Save propertyhive/6dc31e0a8d531b5d74cfe7336f05c9bd to your computer and use it in GitHub Desktop.

Select an option

Save propertyhive/6dc31e0a8d531b5d74cfe7336f05c9bd to your computer and use it in GitHub Desktop.
$tax_query = $query->get('tax_query');
if ( !is_array($tax_query) ) { $tax_query = array(); }
$tax_query[] = [
'taxonomy' => 'availability',
'field' => 'ID',
'terms' => ['4', '5', '104'],
'operator' => 'NOT IN',
];
$query->set('tax_query', $tax_query);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment