Skip to content

Commit

Permalink
Add woocommerce_loop_product_link filter
Browse files Browse the repository at this point in the history
  • Loading branch information
WPprodigy committed Dec 25, 2017
1 parent eb60a17 commit 0192fb9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion includes/wc-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,11 @@ function woocommerce_template_loop_category_title( $category ) {
* 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">';
}
}

Expand Down

0 comments on commit 0192fb9

Please sign in to comment.