woocommerce_order_item_name

The WooCommerce woocommerce order item name hook.

Description

apply_filters( 'woocommerce_order_item_name', (string) $item_get_name, (unknown) $item, (unknown) $is_visible ); 

Parameters (3)

0. $item_get_name (string)
The product permalink sprintf a href s s a product permalink item get name item get name.
1. $item (unknown)
The item.
2. $is_visible (unknown)
The is visible.

Usage

To run the hook, copy the example below.
  1. $item_get_name = apply_filters( 'woocommerce_order_item_name', $item_get_name, $item, $is_visible ); 
  2.  
  3. if ( !empty( $item_get_name ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the woocommerce_order_item_name callback 
  2. function filter_woocommerce_order_item_name( $item_get_name, $item, $is_visible ) { 
  3. // make filter magic happen here... 
  4. return $item_get_name
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_order_item_name', 'filter_woocommerce_order_item_name', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_order_item_name', 'filter_woocommerce_order_item_name', 10, 3 ); 

Defined (5)

The filter is defined in the following location(s).

/templates/order/order-details-item.php  
  1. echo apply_filters( 'woocommerce_order_item_name', $product_permalink ? sprintf( '<a href="%s">%s</a>', $product_permalink, $item->get_name() ) : $item->get_name(), $item, $is_visible ); 
/templates/emails/plain/email-order-items.php  
  1. echo apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ); 
/templates/emails/email-order-items.php  
  1. echo apply_filters( 'woocommerce_order_item_name', $item->get_name(), $item, false ); 
/templates/checkout/form-pay.php  
  1. echo apply_filters( 'woocommerce_order_item_name', esc_html( $item->get_name() ), $item, false ); 
/includes/class-wc-structured-data.php  
  1. 'name' => apply_filters( 'woocommerce_order_item_name', $item['name'], $item, $is_visible ),