Check passed in variables are set

#9983
This commit is contained in:
Mike Jolley 2016-01-06 11:52:16 +00:00
parent e4c45c0c47
commit 1093d2f64c
1 changed files with 2 additions and 2 deletions

View File

@ -24,10 +24,10 @@ global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s">%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( $quantity ),
esc_attr( isset( $quantity ) ? $quantity : 1 ),
esc_attr( $product->id ),
esc_attr( $product->get_sku() ),
esc_attr( $class ),
esc_attr( isset( $class ) ? $class : 'button' ),
esc_html( $product->add_to_cart_text() )
),
$product );