WordPress filter hook
woocommerce_order_item_display_meta_key
Defined by WooCommerce and fired by 7 plugins in total, running on 7M+ sites between them.
“WooCommerce core filters (includes/class-wc-order-item.php) that plugins use to label their order meta.”
How to use woocommerce_order_item_display_meta_key
It's a filter: your callback receives the value and 2 more arguments, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_order_item_display_meta_key', function( $display_key, $meta, $object ) {
// Change $display_key here.
return $display_key;
}, 10, 3 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
7 plugins that fire woocommerce_order_item_display_meta_key
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_order_item_display_meta_key', $display_key, $meta, $this )includes/class-wc-order-item.php:372 -
MKL Product Configurator for WooCommerce2,000+ installs
apply_filters( 'woocommerce_order_item_display_meta_key', $pair['key'], $meta, $order_item )inc/frontend/order.php:403 -
Address Book & Multiple Shipping for WooCommerce1,000+ installs
apply_filters( 'woocommerce_order_item_display_meta_key', $display_key, $addrs_value, $order_item )public/class-thmaf-public.php:2992 -
WebPOS40+ installs
apply_filters( 'woocommerce_order_item_display_meta_key', wc_attribute_label( $attribute_key, $product ), $v, $item )includes/templates/viwebpos-receipt.php:345 -
Wallet Ready Gift Cards for WooCommerce by GiftRocketWP30+ installs
apply_filters( 'woocommerce_order_item_display_meta_key', $label, $meta, $item )frontend/frontend.php:1381 -
Pizza builder for WooCommerce30+ installs
apply_filters( 'woocommerce_order_item_display_meta_key', $meta->key, $meta )includes/pizza-checkout.php:189 -
QuoteLaneFewer than 10 installs
apply_filters( 'woocommerce_order_item_display_meta_key', wc_attribute_label( (string) $d['key'], $line['data'] ), $m, $item )includes/class-line-options.php:81
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.