Hi,
If I enable debugging in WordPress I constantly get following error messages
—–
09-Dec-2016 13:25:44 UTC] PHP Notice: Undefined variable: image_html in /websites/123reg/LinuxPackage22/fl/ig/ht/flighttraininglondon.co.uk/public_html/webshop/wp-content/themes/neighborhood/woocommerce/single-product/product-image.php on line 84
[09-Dec-2016 13:25:44 UTC] PHP Notice: Undefined variable: image_html in /websites/123reg/LinuxPackage22/fl/ig/ht/flighttraininglondon.co.uk/public_html/webshop/wp-content/themes/neighborhood/woocommerce/single-product/product-image.php on line 138
—-
If I look at the code in product-image.php
then the variable image_html is indeed set after it was used.
—snip
if ( $product_image_srcset ) {
$image = get_the_post_thumbnail( $post->ID, apply_filters( ‘single_product_large_thumbnail_size’, ‘shop_single’ ), array(
‘title’ => get_the_title( get_post_thumbnail_id() )
) );
echo apply_filters( ‘woocommerce_single_product_image_html’, sprintf( ‘<li itemprop=”image” data-thumb=”%s”>%s%s<i class=”fa-search-plus”></i>‘, $thumb_image, $image_html, $caption_html, $image_link, $image_caption, $image_title, $image_alt ), $post->ID );
} else {
$image = aq_resize( $image_link, 800, NULL, true, false);
if ($image) {
$image_html = ‘‘;
echo apply_filters( ‘woocommerce_single_product_image_html’, sprintf( ‘<li itemprop=”image” data-thumb=”%s”>%s%s<i class=”fa-search-plus”></i>‘, $thumb_image, $image_html, $caption_html, $image_link, $image_caption, $image_title, $image_alt ), $post->ID );
}
}
–snip
What is the best approach to fix this bug.
Thanks
Kind regards,
Ivan