woocommerce_variation_is_active
Controls whether this particular variation will appear greyed-out (inactive) or not (active). Used by extensions to make incompatible variations appear greyed-out, etc. Other possible uses: prevent out-of-stock variations from being selected.
Usage
add_filter( 'woocommerce_variation_is_active', 'wp_kama_woocommerce_variation_is_active_filter', 10, 2 );
/**
* Function for `woocommerce_variation_is_active` filter-hook.
*
* @param $true
* @param $that
*
* @return
*/
function wp_kama_woocommerce_variation_is_active_filter( $true, $that ){
// filter...
return $true;
}
- $true
- -
- $that
- -
Where the hook is called
woocommerce_variation_is_active
woocommerce/includes/class-wc-product-variation.php 573
return apply_filters( 'woocommerce_variation_is_active', true, $this );