WordPress filter hook
woocommerce_product_variation_title_include_attributes
Defined by WooCommerce and fired by 5 plugins in total, running on 7.1M+ sites between them.
“Filters whether variation product titles should include attributes.”
How to use woocommerce_product_variation_title_include_attributes
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_product_variation_title_include_attributes', function( $should_include_attributes, $product ) {
// Change $should_include_attributes here.
return $should_include_attributes;
}, 10, 2 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
5 plugins that fire woocommerce_product_variation_title_include_attributes
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include_attributes, $product )includes/data-stores/class-wc-product-variation-data-store-cpt.php:356 -
BEAR30,000+ installs
apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include_attributes, $product )classes/models/products.php:1525 -
WP All Import20,000+ installs
apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include_attributes, $product )libraries/importer/products/ImportProductBase.php:62 -
Gift Vouchers for WooCommerce80+ installs
apply_filters( 'woocommerce_product_variation_title_include_attributes', true, $product )includes/wgv_core/class-wgv-voucher.php:329 -
PerfLocaleFewer than 10 installs
apply_filters( 'woocommerce_product_variation_title_include_attributes', $should_include, $variation )addons/woocommerce/PerfLocaleWooCommerce.php:2078
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.