Function exists for wp_get_attachment_image_srcset and sizes

Sizes #9714
This commit is contained in:
Mike Jolley 2015-11-27 11:30:47 +00:00
parent f9756b29f1
commit 615c262f6f
1 changed files with 2 additions and 2 deletions

View File

@ -563,8 +563,8 @@ class WC_Product_Variable extends WC_Product {
$image_link = $full_attachment ? current( $full_attachment ) : '';
$image_title = get_the_title( $attachment_id );
$image_alt = get_post_meta( $attachment_id, '_wp_attachment_image_alt', true );
$image_srcset = wp_get_attachment_image_srcset( $attachment_id, 'shop_single' );
$image_sizes = wp_get_attachment_image_sizes( $attachment_id, 'shop_single' );
$image_srcset = function_exists( 'wp_get_attachment_image_srcset' ) ? wp_get_attachment_image_srcset( $attachment_id, 'shop_single' ) : false;
$image_sizes = function_exists( 'wp_get_attachment_image_sizes' ) ? wp_get_attachment_image_sizes( $attachment_id, 'shop_single' ) : false;
} else {
$image = $image_link = $image_title = $image_alt = $image_srcset = $image_sizes = '';
}