woocommerce_product_variation_title_include_attributes
Filters whether variation product titles should include attributes.
Usage
add_filter( 'woocommerce_product_variation_title_include_attributes', 'wp_kama_woocommerce_product_variation_title_include_attributes_filter', 10, 2 );
/**
* Function for `woocommerce_product_variation_title_include_attributes` filter-hook.
*
* @param bool $should_include_attributes Whether attributes should be included.
* @param WC_Product $product Variation product object.
*
* @return bool
*/
function wp_kama_woocommerce_product_variation_title_include_attributes_filter( $should_include_attributes, $product ){
// filter...
return $should_include_attributes;
}
- $should_include_attributes(true|false)
- Whether attributes should be included.
- $product(WC_Product)
- Variation product object.
Changelog
| Since 3.0.2 | Introduced. |
Where the hook is called
woocommerce_product_variation_title_include_attributes
woocommerce/includes/data-stores/class-wc-product-variation-data-store-cpt.php 356
return (bool) apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include_attributes, $product );