woocommerce_product_attribute_term_name │ хук-фильтр │ WC 3.4.0

Filter the selected attribute term name.

Использование

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(строка)
Name of selected term.
$term(массив)
The selected term object.

Список изменений

С версии 3.4.0 Введена.

Где вызывается хук

В файле: /includes/admin/meta-boxes/views/html-product-attribute-inner.php
woocommerce_product_attribute_term_name
woocommerce/includes/admin/meta-boxes/views/html-product-attribute-inner.php 101
echo '<option' . $option_attribute_string . '>' . esc_html( apply_filters( 'woocommerce_product_attribute_term_name', $selected_term->name, $selected_term ) ) . '</option>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped

Где используется хук в WooCommerce

Использование не найдено.