admin管理员组

文章数量:1435776

When adding content into the description and short description fields for a product, line-breaks and

tags are completely removed from the markup. Other than installing Advanced TinyMCE, is there any setting, filter, or hook I need to check to make these fields include

elements.

In review of the Product object array in WooCommerce, it looks like the value for description is wrapped in the wpautop() function, but it doesn't appear to be working (it's possibly I'm just not understanding this part of the code correctly within the plugin).

Any ideas on how to force paragraphs into short/description content in WooCommerce?

Note: I only have ACF and WooCommerce installed as plugins. I'm using Underscores as a parent theme to build my own custom theme and product templates.

When adding content into the description and short description fields for a product, line-breaks and

tags are completely removed from the markup. Other than installing Advanced TinyMCE, is there any setting, filter, or hook I need to check to make these fields include

elements.

In review of the Product object array in WooCommerce, it looks like the value for description is wrapped in the wpautop() function, but it doesn't appear to be working (it's possibly I'm just not understanding this part of the code correctly within the plugin).

Any ideas on how to force paragraphs into short/description content in WooCommerce?

Note: I only have ACF and WooCommerce installed as plugins. I'm using Underscores as a parent theme to build my own custom theme and product templates.

Share Improve this question asked Mar 30, 2019 at 17:48 macondo_buendiamacondo_buendia 1051 silver badge8 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 6

So, I realized I was using the actual object in the template to call the description $product-get_description(). If you're experiencing this issue, then you can wrap this in a wpautop(), or you can do what WC actually does (not sure how I didn't remember) and use the simple the_content() function to get the description. That will wrap any line breaks in your the editor with <p> tags if you want them.

本文标签: wp autopWooCommerce Description and Short Description ltpgt tags removal