Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created February 5, 2021 18:54
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 djrmom/c467b5ce8eae28e98115d6bcf9e7d377 to your computer and use it in GitHub Desktop.
Save djrmom/c467b5ce8eae28e98115d6bcf9e7d377 to your computer and use it in GitHub Desktop.
facetwp woocommerce product visibility
// example for product visibility for woocommerce query
// hides out of stock
'tax_query' => array(
array(
'taxonomy' => 'product_visibility',
'field' => 'name',
'terms' => 'outofstock',
'operator' => 'NOT IN',
),
),
// other terms: 'exclude-from-search', 'exclude-from-catalog', 'featured', 'outofstock'
// ref: https://wordpress.stackexchange.com/questions/231118/wp-query-exclude-hidden-products-from-woocommerce-product-list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment