woocommerce_is_attribute_in_product_name
Filters whether an attribute value is already shown in the attributes area of a variation name.
Usage
add_filter( 'woocommerce_is_attribute_in_product_name', 'wp_kama_woocommerce_is_attribute_in_product_name_filter', 10, 4 );
/**
* Function for `woocommerce_is_attribute_in_product_name` filter-hook.
*
* @param bool $is_in_name Whether the attribute value was found in the name.
* @param string $attribute Attribute value checked for.
* @param string $name Product name checked in.
* @param WC_Product|null $product Variation the name belongs to, when known.
*
* @return bool
*/
function wp_kama_woocommerce_is_attribute_in_product_name_filter( $is_in_name, $attribute, $name, $product ){
// filter...
return $is_in_name;
}
- $is_in_name(true|false)
- Whether the attribute value was found in the name.
- $attribute(string)
- Attribute value checked for.
- $name(string)
- Product name checked in.
- $product(WC_Product|null)
- Variation the name belongs to, when known.
Changelog
| Since 3.0.2 | Introduced. |
| Since 11.3.0 | Added the $product parameter. |
Where the hook is called
woocommerce_is_attribute_in_product_name
woocommerce/includes/wc-attribute-functions.php 482
return apply_filters( 'woocommerce_is_attribute_in_product_name', $is_in_name, $attribute, $name, $product );