woocommerce_product_is_visible хук-фильтрWC 1.0

Returns whether or not the product is visible in the catalog.

Использование

add_filter( 'woocommerce_product_is_visible', 'wp_kama_woocommerce_product_is_visible_filter', 10, 2 );

/**
 * Function for `woocommerce_product_is_visible` filter-hook.
 * 
 * @param  $visible 
 * @param  $id      
 *
 * @return 
 */
function wp_kama_woocommerce_product_is_visible_filter( $visible, $id ){

	// filter...
	return $visible;
}
$visible
-
$id
-

Где вызывается хук

WC_Product::is_visible()
woocommerce_product_is_visible
woocommerce/includes/abstracts/abstract-wc-product.php 1574
return apply_filters( 'woocommerce_product_is_visible', $visible, $this->get_id() );

Где используется хук в WooCommerce

woocommerce/includes/shortcodes/class-wc-shortcode-products.php 657
add_action( 'woocommerce_product_is_visible', array( $this, 'set_product_as_visible' ) );
woocommerce/includes/shortcodes/class-wc-shortcode-products.php 663
remove_action( 'woocommerce_product_is_visible', array( $this, 'set_product_as_visible' ) );