woocommerce_product_add_to_cart_aria_describedby хук-фильтрWC 7.8.0

Filter the aria-describedby description for the add to cart button.

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

add_filter( 'woocommerce_product_add_to_cart_aria_describedby', 'wp_kama_woocommerce_product_add_to_cart_aria_describedby_filter', 10, 2 );

/**
 * Function for `woocommerce_product_add_to_cart_aria_describedby` filter-hook.
 * 
 * @param string     $var  Text for the 'aria-describedby' attribute.
 * @param WC_Product $that Product object.
 *
 * @return string
 */
function wp_kama_woocommerce_product_add_to_cart_aria_describedby_filter( $var, $that ){

	// filter...
	return $var;
}
$var(строка)
Text for the 'aria-describedby' attribute.
$that(WC_Product)
Product object.

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

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

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

WC_Product::add_to_cart_aria_describedby()
woocommerce_product_add_to_cart_aria_describedby
WC_Product_Variable::add_to_cart_aria_describedby()
woocommerce_product_add_to_cart_aria_describedby
woocommerce/includes/abstracts/abstract-wc-product.php 1990
return apply_filters( 'woocommerce_product_add_to_cart_aria_describedby', '', $this );
woocommerce/includes/class-wc-product-variable.php 67
return apply_filters( 'woocommerce_product_add_to_cart_aria_describedby', $this->is_purchasable() ? __( 'This product has multiple variants. The options may be chosen on the product page', 'woocommerce' ) : '', $this );

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

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