From 2638f61a8616babbf0b76cb687ce0b87120fd5e9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 7 Apr 2017 17:05:28 +0100 Subject: [PATCH] Prevent notice in thumbnails html Fixes #14114 --- templates/single-product/product-thumbnails.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/single-product/product-thumbnails.php b/templates/single-product/product-thumbnails.php index 5afcd9eebed..e1f64d8fe11 100644 --- a/templates/single-product/product-thumbnails.php +++ b/templates/single-product/product-thumbnails.php @@ -29,7 +29,7 @@ if ( $attachment_ids && has_post_thumbnail() ) { $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->post_content; + $image_title = $thumbnail_post ? $thumbnail_post->post_content : ''; $attributes = array( 'title' => $image_title,