oEmbed in Comments

Last week I tried to embed a tweet in a comment reply here, and I was sad when I realized that comments don’t get the same oEmbed magic that posts do. I thought about making a core ticket to add this — and I still may do that eventually — but decided to make it a plugin first.

Over the weekend I wrote it, and earlier today I released oEmbed in Comments on the WordPress.org repository today. It’s also on Github.

It’s really simple. Once activated, if someone posts a comment with a stand-alone URL pointing to an approved oEmbed provider (like YouTube or Twitter) it will grab the media and replace the link with an embed. There’s no UI and no settings, just activate the plugin and it works.

If you search for this kind of thing, you may find an old plugin called oEmbed for Comments (lots of creative naming here). I originally thought I might just use that, but on closer inspection I didn’t like the way the plugin worked. It sort of used WordPress core’s oEmbed functionality, but it also rewrote a significant part of that on its own. On top of that, it hasn’t been updated in two and a half years, which isn’t a good sign.

In the end, I decided I’d be happier with something simpler and done from scratch.

8 thoughts on “oEmbed in Comments

  1. Japh

    I hadn’t realised either that the oEmbed functionality was only for post content and didn’t already extend to comments etc. as well.

    Thanks for solving my problem before I realised I had it :)

    Plugin installed.

    Reply
    1. evan Post author

      Have you considered opening a feature request for this in core trac?

      Funny you should ask…

      I thought about making a core ticket to add this — and I still may do that eventually — but decided to make it a plugin first

      First paragraph of the post

      Reply
  2. Pingback: oEmbed in WordPress Comments — Konstantin Kovshenin

  3. Parker

    Sorry for using your blog, but I don’t have a facebook or anything, and when I left a eply on the plugin page, it wouldn’t post it even though I was logged in. Anyway, I installed buddypig (using all required software versions) and my site crashed. as in, I am not able to view any part of it whatsoever. HELP ME PLEASE

    Reply
    1. evan Post author

      You should probably start by deleting the plugin via FTP or SSH.

      It would be ideal if you could post in the support forum. If you can’t login there for some reason, there’s a temporary placeholder site setup for BuddyPig here.

      Wherever you post next, please try to find more information about what went wrong from your error logs.

      Reply

Leave a Reply