Merge branch 'pr/15219'

This commit is contained in:
Mike Jolley 2017-05-23 19:28:45 +01:00
commit 41e8b22b5a
1 changed files with 3 additions and 10 deletions

View File

@ -786,18 +786,11 @@ if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) {
* @return string
*/
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $deprecated1 = 0, $deprecated2 = 0 ) {
global $post;
global $product;
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
if ( has_post_thumbnail() ) {
$props = wc_get_product_attachment_props( get_post_thumbnail_id(), $post );
return get_the_post_thumbnail( $post->ID, $image_size, array(
'title' => $props['title'],
'alt' => $props['alt'],
) );
} elseif ( wc_placeholder_img_src() ) {
return wc_placeholder_img( $image_size );
}
return $product ? $product->get_image( $image_size ) : '';
}
}