How do you escape these two examples?
wc_price()
wraps the already escaped $product_price
in p
and span
tags with currency symbol.
$product_price = $product->get_price();
<p><?php echo wc_price( esc_html( $product_price ) ); ?></p>
The next one outputs the complete image with all attributes: src
, srcset
, alt
, etc.
$product_img = $product->get_image();
<?php echo $product_img; ?>