woocommerce_blocks_product_grid_add_to_cart_attributes

woocommerce_blocks_product_grid_add_to_cart_attributes

Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.3.1

apply_filters('woocommerce_blocks_product_grid_add_to_cart_attributes') is found 1 times:

  • /src/Blocks/BlockTypes/AbstractProductGrid.php line 679
    		 * @param WC_Product $product    The WC_Product instance of the product that will be added to the cart once the button is pressed.
    		 *
    		 * @return array Returns an associative array derived from the default array passed as an argument and added the extra HTML attributes.
    		 */
    		$attributes = apply_filters( 'woocommerce_blocks_product_grid_add_to_cart_attributes', $attributes, $product );
    
    		return sprintf(
    			'<a href="%s" %s>%s</a>',
    			esc_url( $product->add_to_cart_url() ),
    			wc_implode_html_attributes( $attributes ),
    			esc_html( $product->add_to_cart_text() )