Add woocommerce_loop_product_link filter

This commit is contained in:
Caleb Burks 2017-12-25 02:20:40 -06:00
parent eb60a17818
commit 0192fb9ef0
1 changed files with 5 additions and 1 deletions

View File

@ -778,7 +778,11 @@ if ( ! function_exists( 'woocommerce_template_loop_product_link_open' ) ) {
* Insert the opening anchor tag for products in the loop.
*/
function woocommerce_template_loop_product_link_open() {
echo '<a href="' . esc_url( get_the_permalink() ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
global $product;
$link = apply_filters( 'woocommerce_loop_product_link', get_the_permalink(), $product );
echo '<a href="' . esc_url( $link ) . '" class="woocommerce-LoopProduct-link woocommerce-loop-product__link">';
}
}