Merge branch 'pr/15219'
This commit is contained in:
commit
41e8b22b5a
|
@ -786,18 +786,11 @@ if ( ! function_exists( 'woocommerce_get_product_thumbnail' ) ) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $deprecated1 = 0, $deprecated2 = 0 ) {
|
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 );
|
$image_size = apply_filters( 'single_product_archive_thumbnail_size', $size );
|
||||||
|
|
||||||
if ( has_post_thumbnail() ) {
|
return $product ? $product->get_image( $image_size ) : '';
|
||||||
$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 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue