Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ahmedeshaan/5e7dee8dd40d01b83c3c55447d65625e to your computer and use it in GitHub Desktop.
Save ahmedeshaan/5e7dee8dd40d01b83c3c55447d65625e to your computer and use it in GitHub Desktop.
function woocommerce_get_product_thumbnail( $size = 'shop_catalog', $deprecated1 = 0, $deprecated2 = 0 ) {
global $post;
$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' => esc_attr(get_the_title()),
'alt' => esc_attr(get_the_title()),
) );
} elseif ( wc_placeholder_img_src() ) {
return wc_placeholder_img( $image_size );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment