Created
April 1, 2021 11:29
-
-
Save ahmedeshaan/453495f39d4e958eeabfde626ef1aa6c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo apply_filters( | |
'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok. | |
sprintf( | |
'<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="add_to_cart add_to_cart_button %s" %s>%s</a>', | |
esc_url( $product->add_to_cart_url() ), | |
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ), | |
esc_attr( $product->get_id() ), | |
esc_attr( $product->get_sku() ), | |
esc_attr( isset( $args['class'] ) ? $args['class'] : 'button' ), | |
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '', | |
esc_html( $product->add_to_cart_text() ) | |
), | |
$product, | |
$args | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment