Advertisement
Guest User

Untitled

a guest
May 27th, 2016
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.30 KB | None | 0 0
  1. function change_image_link($content) {
  2.  
  3.     global $product;
  4.  
  5.     $product_link = '<a href="' . $product->get_product_url();
  6.  
  7.     $content = preg_replace('/(<a href=\")([^\"]*)/i', $product_link, $content);
  8.  
  9. return $content;
  10.  
  11. }
  12.  
  13. add_filter('woocommerce_single_product_image_html', 'change_image_link');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement