woocommerce_customer_stock_notifications_product_is_valid
Filter: woocommerce_customer_stock_notifications_product_is_valid Allows custom validation for whether a product is generally eligible for notifications.
Usage
add_filter( 'woocommerce_customer_stock_notifications_product_is_valid', 'wp_kama_woocommerce_customer_stock_notifications_product_is_valid_filter', 10, 2 );
/**
* Function for `woocommerce_customer_stock_notifications_product_is_valid` filter-hook.
*
* @param bool $is_valid True if the product is valid for notifications, false otherwise.
* @param WC_Product $product The product to check.
*
* @return bool
*/
function wp_kama_woocommerce_customer_stock_notifications_product_is_valid_filter( $is_valid, $product ){
// filter...
return $is_valid;
}
- $is_valid(true|false)
- True if the product is valid for notifications, false otherwise.
- $product(WC_Product)
- The product to check.
Changelog
| Since 10.2.0 | Introduced. |
Where the hook is called
woocommerce_customer_stock_notifications_product_is_valid
woocommerce/src/Internal/StockNotifications/Utilities/EligibilityService.php 74
return (bool) apply_filters( 'woocommerce_customer_stock_notifications_product_is_valid', true, $product );