diff --git a/templates/single-product/product-image.php b/templates/single-product/product-image.php index 79c7be7fa2d..95997ea245c 100644 --- a/templates/single-product/product-image.php +++ b/templates/single-product/product-image.php @@ -19,10 +19,12 @@ global $post, $woocommerce, $product; ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( - 'title' => $image_title + $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) ); + $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; + $image_link = wp_get_attachment_url( get_post_thumbnail_id() ); + $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( + 'title' => $image_title, + 'alt' => $image_title ) ); $attachment_count = count( $product->get_gallery_attachment_ids() ); @@ -33,7 +35,7 @@ global $post, $woocommerce, $product; $gallery = ''; } - echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image_link, $image_title, $image ), $post->ID ); + echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '%s', $image_link, $image_caption, $image ), $post->ID ); } else {