woocommerce_product_add_to_cart_aria_describedby filter-hookWC 7.8.0

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

Usage

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(string)
Text for the 'aria-describedby' attribute.
$that(WC_Product)
Product object.

Changelog

Since 7.8.0 Introduced.

Where the hook is called

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 1953
return apply_filters( 'woocommerce_product_add_to_cart_aria_describedby', '', $this );
woocommerce/includes/class-wc-product-variable.php 65
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 );

Where the hook is used in WooCommerce

Usage not found.