Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Remove placeholder image rendering as it's covered in Core function g…
Browse files Browse the repository at this point in the history
…et_image anyway (#12098)

Co-authored-by: Daniel Dudzic <[email protected]>
  • Loading branch information
kmanijak and danieldudzic authored Dec 9, 2023
1 parent 7b3bafe commit 2230f68
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/BlockTypes/ProductImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,19 +162,6 @@ private function render_image( $product, $attributes ) {
$image_style .= sprintf( 'aspect-ratio:%s;', $attributes['aspectRatio'] );
}

if ( ! $product->get_image_id() ) {
// The alt text is left empty on purpose, as it's considered a decorative image.
// More can be found here: https://www.w3.org/WAI/tutorials/images/decorative/.
// Github discussion for a context: https://github.com/woocommerce/woocommerce-blocks/pull/7651#discussion_r1019560494.
return wc_placeholder_img(
$image_size,
array(
'alt' => '',
'style' => $image_style,
)
);
}

return $product->get_image(
$image_size,
array(
Expand Down

0 comments on commit 2230f68

Please sign in to comment.