Hook for single product thumbnail

Here’s what I believe is an updated version of one of the other answers’ comments. This function replaces the width and height attributes, but OP wanted to change the src. I imagine the solution would be similar, except using preg_replace to replace the src instead.


function remove_single_product_image_attrs( $sprintf, $post_id ){ 
  return preg_replace( '/(width|height)="\d*"\s/', "", $sprintf );