WP Coding standards – escaping the inescapable?

Question

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; ?>
0
, Bonovski 4 years 2020-02-12T08:41:19-05:00 0 Answers 62 views 0

Leave an answer

Browse
Browse