diff --git a/templates/single-product/product-image.php b/templates/single-product/product-image.php index c5e346bfe99..18c50fb695e 100644 --- a/templates/single-product/product-image.php +++ b/templates/single-product/product-image.php @@ -24,8 +24,7 @@ global $post, $product; $columns = apply_filters( 'woocommerce_product_thumbnails_columns', 4 ); $post_thumbnail_id = get_post_thumbnail_id( $post->ID ); $full_size_image = wp_get_attachment_image_src( $post_thumbnail_id, 'full' ); -$thumbnail_post = get_post( $post_thumbnail_id ); -$image_title = $thumbnail_post->post_excerpt; +$image_title = get_post_field( 'post_excerpt', $post_thumbnail_id ); $placeholder = has_post_thumbnail() ? 'with-images' : 'without-images'; $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_classes', array( 'woocommerce-product-gallery', diff --git a/templates/single-product/product-thumbnails.php b/templates/single-product/product-thumbnails.php index e1f64d8fe11..67e15ec6ba8 100644 --- a/templates/single-product/product-thumbnails.php +++ b/templates/single-product/product-thumbnails.php @@ -13,7 +13,7 @@ * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates - * @version 3.0.0 + * @version 3.0.2 */ if ( ! defined( 'ABSPATH' ) ) { @@ -26,10 +26,9 @@ $attachment_ids = $product->get_gallery_image_ids(); if ( $attachment_ids && has_post_thumbnail() ) { foreach ( $attachment_ids as $attachment_id ) { - $full_size_image = wp_get_attachment_image_src( $attachment_id, 'full' ); - $thumbnail = wp_get_attachment_image_src( $attachment_id, 'shop_thumbnail' ); - $thumbnail_post = get_post( $attachment_id ); - $image_title = $thumbnail_post ? $thumbnail_post->post_content : ''; + $full_size_image = wp_get_attachment_image_src( $attachment_id, 'full' ); + $thumbnail = wp_get_attachment_image_src( $attachment_id, 'shop_thumbnail' ); + $image_title = get_post_field( 'post_excerpt', $attachment_id ); $attributes = array( 'title' => $image_title,