HTML in product attributes ( tag)
-
Hi
I’m looking to include links in the custom products attributes on my website (in my case, links to PDF technical sheets). Problem is Woocommerce sanitizes HTML markup and displays it as text instead of interpretating it.
I have searched the web extensively, tried every snippet of PHP code proposed, nothing worked.
Only solution I found working was to include “html_entity_decode( … )” in the product_attributes.php Woocommerce file. It gives:
<td class="woocommerce-product-attributes-item__value"><?php echo html_entity_decode( wp_kses_post( $product_attribute['value'] ) ); ?></td>
However, after each update (and they come often), it resets even though the file has not been improved. So I have to make the change over and over. I’m looking for some solution where I don’t have to change that file every time I’m updating Woocommerce.
Does anyone have a simple solution? Through functions.php or anything, but just telling Woocommerce “don’t sanitize links”?
- The topic ‘HTML in product attributes ( tag)’ is closed to new replies.