最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

wp autop - WooCommerce Description and Short Description <p> tags removal

programmeradmin2浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论