WordPress filter hook

woocommerce_product_is_visible

Defined by WooCommerce and fired by 9 plugins in total, running on 7M+ sites between them.

“Filters whether a product is visible: WooCommerce's own filter, which WC_Product::is_visible() ends with. Applied here so a product hidden there (for example by Tack_Catalog_Visibility) cannot be quoted.”

How to use woocommerce_product_is_visible

It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'woocommerce_product_is_visible', function( $visible, $arg2 ) {
	// Change $visible here.
	return $visible;
}, 10, 2 );

Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

9 plugins that fire woocommerce_product_is_visible

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_product_is_visible', $visible, $this->get_id() ) includes/abstracts/abstract-wc-product.php:1840
  2. Restaurant Menu / bulk order plugin for WooCommerce icon Restaurant Menu / bulk order plugin for WooCommerce20+ installs apply_filters( 'woocommerce_product_is_visible', true, $loop->get_the_ID() ) front/view/child-cat-product-loop.php:16
  3. QODE Product Bundles for WooCommerce icon QODE Product Bundles for WooCommerce10+ installs apply_filters( 'woocommerce_product_is_visible', $visible, $this->get_id() ) inc/bundle-product/woocommerce/class-wc-product-qode-bundle-product.php:214
  4. TackQuote: Request a Quote & B2B Wholesale for WooCommerce icon TackQuote: Request a Quote & B2B Wholesale for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', true, $visible_id ) includes/class-tack-widget.php:2405
  5. AovUp Quick Order Form for WooCommerce icon AovUp Quick Order Form for WooCommerceFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', $listed, $product->get_id() ) includes/class-aovup-qof-products.php:107
  6. Searcio icon SearcioFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', $visible, $product->get_id() ) includes/Indexing/Woo.php:176
  7. Portus Wishlist Radar icon Portus Wishlist RadarFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', 'hidden' !== $parent->get_catalog_visibility(), $parent->get_id() ) includes/class-pwr-plugin.php:245
  8. PPL Search Suite icon PPL Search SuiteFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', true, $product->get_id() ) includes/class-ppl-search-suite-wporg-catalog.php:232
  9. Giftlight icon GiftlightFewer than 10 installs apply_filters( 'woocommerce_product_is_visible', true, $id ) giftlight.php:420

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.