Disable wpautop on embeds
When some embeds are inserted into the_content
by WP_Embed
, wpautop
wraps them in <p>
tags. This behavior is not ideal. The reason for this is that some embeds, like YouTube, are not wrapped in a block element. The WP_Embed
class has a filter, embed_handler_html
, which can be used to override this behavior by wrapping the embed in a block element.
Usage: