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

Remove placeholder image rendering and delegate it to Core's get_image function #12098

Merged
merged 2 commits into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading