WordPress filter hook
woocommerce_attribute_label
Defined by WooCommerce and fired by 9 plugins in total, running on 7.1M+ sites between them.
How to use woocommerce_attribute_label
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_attribute_label', function( $attribute_label, $name ) {
// Change $attribute_label here.
return $attribute_label;
}, 10, 2 );Argument names come from YITH Request a Quote for WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
9 plugins that fire woocommerce_attribute_label
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_attribute_label', $label, $name, $product )includes/wc-attribute-functions.php:238 -
Dokan: AI Powered WooCommerce Multivendor Marketplace Solution30,000+ installs
apply_filters( 'woocommerce_attribute_label', $attribute['name'], $attribute['name'], false )includes/Product/ProductAttribute.php:144 -
WCFM10,000+ installs
apply_filters( 'woocommerce_attribute_label', $wcfm_attribute['name'], $wcfm_attribute['name'], $product )views/products-manager/wcfm-view-products-manage.php:270 -
YITH Request a Quote for WooCommerce10,000+ installs
apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $name ), $name )includes/functions.yith-request-quote.php:56 -
Invoices for WooCommerce10,000+ installs
apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $meta['meta_key'], $product ), $meta['meta_key'], $product )includes/templates/invoice/simple/micro/body.php:118 -
WC Vendors3,000+ installs
apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $meta->key, $wc_product ), $meta->key )classes/admin/class-wcv-vendor-order-page.php:382 -
WPCafe Multivendor Restaurant Addon for Dokan100+ installs
apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $meta['meta_key'], $_product ), $meta['meta_key'] )templates/orders/order-item-html.php:78 -
PW WooCommerce Let’s Export!10+ installs
apply_filters( 'woocommerce_attribute_label', $meta_key, $meta_key, false )includes/abstracts/abstract-pwle-input.php:86 -
S2 Subscription for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_attribute_label', wc_attribute_label( $name ), $name )includes/class.s2-subscription.php:333
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.