Hello,
my vendors sometimes by mistakes put html tags in product description and it will deformat a donts. I figured how to solve this by this snippet. It works fine in the single product but not in product archive. Can you tell me which hook should I use to target desc at product archive?
Image in attach. Try to hover over product: https://mintmarket.online/prodejce/everything/
function stripe_woocommerce_short_description($the_excerpt) {
//wp_strip_all_tags will strip all HTML tags including script and style.
//return wp_strip_all_tags($the_excerpt);
//pass second parameter true if you want to remove break tag <br/> also.
//return wp_strip_all_tags( $the_excerpt, true );
//For Keep specific tags
return strip_tags($the_excerpt,"<img /><table><p><li><ul>");
}
add_filter('woocommerce_short_description', 'stripe_woocommerce_short_description',10, 1);
Thank you very much
-
This topic was modified 2 years, 1 month ago by Artem Temos.
Attachments:
You must be
logged in to view attached files.