Cant give a reduced code example right not because my Advanced Responsive Video Embedder plugin is somewhat complicated. But the exact same code is used to generate the embeds, its just through shortcode or autoembed.

I generate the exact same content with shortcodes or with autoembeds. Wordpress ads a <p> and a <br> to the content put out when I embed videos with autoembeds but not when I embed it with shortcodes.

The HTML does not has any line breaks in it. Is seems wordPress is treating the output as normal content and thats probably results in putting a <p> arround a HTML comment and and a <br> after a <img>. My guess is that WP does not do this for content from shortcodes but for autoembeds.

Is there a way to prevent this? I know a way to remove it with JS later but my base plugins functionality has no JS file at all anf it would feel hacky and bloated for me to add one just for that.

  • This question needs to be re-written. What is an ARVE plugin? What is an autoembed? An embed is a file that is attached to another file (like a video). I'm pretty sure your actually talking about the default content filters in posts but that's not what you wrote. – Jim Maguire Jun 19 '16 at 0:38
  • Sorry edited it. – NextGenThemes Jun 22 '16 at 1:14

As far as I know, ARVE is no longer necessary to use. As well, Wordpress does not add p nor br tags ever. So if they are being added, you probably have a third party editor which adds them or maybe a custom function. Either way, you can probably disable that feature.

  • What do you mean by "no longer" necessary to use? It was never "necessary" but it makes video embedding way better. – NextGenThemes Jun 22 '16 at 0:43
  • How is this leading to a solution to the issue here? – Joshua Baer Jun 23 '16 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.