Remove opening and closing paragraph when applying “the_content” filter
-
I have a custom snippet that I want to support all the filters added to the_content—like shortcodes, wptexturize and the like, so I do this:
$template = apply_filters('the_content', $template);
The problem is that it causes a
<p>
and a</p>
at the end of the snippet when used inline, probably caused by the wpautop function. How can I still apply “the_content” filters, while escaping the added paragraphs?Another option is to add specifics filters manually, but many of those are added by other plugins so I may not keep track of them.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove opening and closing paragraph when applying “the_content” filter’ is closed to new replies.