woocommerce_product_attribute_term_name

The WooCommerce woocommerce product attribute term name hook.

Description

apply_filters( 'woocommerce_product_attribute_term_name', (string) $term_name, (unknown) $term ); 

Parameters (2)

0. $term_name (string)
The term name.
1. $term (unknown)
The term.

Usage

To run the hook, copy the example below.
  1. $term_name = apply_filters( 'woocommerce_product_attribute_term_name', $term_name, $term ); 
  2.  
  3. if ( !empty( $term_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_product_attribute_term_name callback 
  2. function filter_woocommerce_product_attribute_term_name( $term_name, $term ) { 
  3. // make filter magic happen here... 
  4. return $term_name
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'woocommerce_product_attribute_term_name', 'filter_woocommerce_product_attribute_term_name', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'woocommerce_product_attribute_term_name', 'filter_woocommerce_product_attribute_term_name', 10, 2 ); 

Defined (1)

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

/includes/admin/meta-boxes/views/html-product-attribute.php  
  1. echo '<option value="' . esc_attr( $term->term_id ) . '" ' . selected( in_array( $term->term_id, $options ), true, false ) . '>' . esc_attr( apply_filters( 'woocommerce_product_attribute_term_name', $term->name, $term ) ) . '</option>';