Could you try clean="true"
with quotes? Also, for any field other than post content, format="false"
by default, so that’s not necessary to specify.
Hopefully that will remove the unwanted paragraph tags.
Thread Starter
flodi
(@flodi)
Nope.
Even with ” I still see the <p>..</p>
I know a little bit of PHP (it is 15 years I develop in PHP 🙂 ) if you want and give me directions I can debug for myself.
OK, I think I’ve found a solution. Please see the latest plugin update.
There is a new settings tab in the documentation area, under Settings -> Custom Content. I added an option to move wp_autop (post content formatting) to after shortcodes are processed. On my test site, this cleans up the unwanted <p>
and <br>
tags.
Please let me know if that does it!
Glad to hear it! This issue of unwanted formatting inside shortcodes has been bugging me for a long time, and it’s great to finally find a solution.
Thread Starter
flodi
(@flodi)
To complete the information, I have to say that to completly clear the <p>s I also had to remove new lines between shortcodes and html tags.
For some reason, I couldn’t recreate the issue of <p>
tags outside shortcodes – when I enable the new setting to move wp_autop, they’re all gone. But, what you say makes sense because the setting only applies to what’s inside shortcodes, so anything outside can still be formatted.
One last thing I forgot to mention: there is a [clean]
shortcode – you can wrap a whole section of HTML code, and it strips all <p>
and <br>
tags inside it. Then you can use [p]
and [br]
shortcodes to manually place them where you want. Not the most elegant solution I’m afraid, but if the new setting isn’t enough, this is another way to prevent formatting.