Wordpress: Advanced Custom Fields Plugin strips out <p> tags?

僤鯓⒐⒋嵵緔 提交于 2019-12-13 21:28:30

问题


I am using the ACF plugin (2.1.4 - latest version) for WordPress (3.2.1 - latest version).

Everything seems to work fine, except for when I use a WYSIWYG field. Any paragraph tags used are not saved to the database. TinyMCE is inserting them when I go to the HTML view, but as soon as I save and look in the DB tables, no paragraph tags are found.

This does not seem to affect other HTML like 'strong' tags etc however, interestingly enough, it does seem to affect 'br' tags as well.

When I save a page and look into the HTML view, they are all still there, but I think this is TinyMCE just doing its own formatting and not the 'literal' content as received from the database.

I reported this problem with an older version of the plugin a long while back which received little to no recognition at all. This is a totally new install of WP and the latest of the plugin so I assumed this bug would have been fixed by now - not so.

So now, instead of relying on them to sort it, I'm hoping for a quick / dirty / hack / fix for the meantime until this happens.

It's a great plugin, but this is a bit of a show stopper for me right now, and I assume others have had this problem too.

Many thanks, Michael.


回答1:


get_field($field_id) instead of get_post_meta will not strip the p tags.



来源:https://stackoverflow.com/questions/7672912/wordpress-advanced-custom-fields-plugin-strips-out-p-tags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!