woocommerce_product_attribute_term_name
Filter the selected attribute term name.
Usage
add_filter( 'woocommerce_product_attribute_term_name', 'wp_kama_woocommerce_product_attribute_term_name_filter', 10, 2 ); /** * Function for `woocommerce_product_attribute_term_name` filter-hook. * * @param string $name Name of selected term. * @param array $term The selected term object. * * @return string */ function wp_kama_woocommerce_product_attribute_term_name_filter( $name, $term ){ // filter... return $name; }
- $name(string)
- Name of selected term.
- $term(array)
- The selected term object.
Changelog
Since 3.4.0 | Introduced. |
Where the hook is called
woocommerce_product_attribute_term_name
woocommerce/includes/admin/meta-boxes/views/html-product-attribute-inner.php 67
echo '<option value="' . esc_attr( $selected_term->term_id ) . '" selected="selected">' . esc_html( apply_filters( 'woocommerce_product_attribute_term_name', $selected_term->name, $selected_term ) ) . '</option>';