Hide YouTube Related Videos
[resolved] Not working with 3.5 (6 posts)

  1. dino golman
    Posted 3 years ago #

    Just not working with WordPress 3.5. Is there any solution for this?


  2. David
    Posted 3 years ago #

    3.5 isn't the issue... the plugin simply doesn't work, because Youtube changed their system.

    You need to replace the ampersands with question marks and remove "?feature=oembed" entirely. I'm not sure if there's a downside to doing this... all I know is that it works.

    Here's the bad code on line 33:
    return str_replace('&feature=oembed', '&feature=oembed&rel=0', $data);

    And here's what it should be:
    return str_replace('?feature=oembed', '?rel=0', $data);

    However, if you're like me and use other embeds, like Flickr, you'll want to make this adjustment for Youtube embeds only. So here's what I changed line 33 to:

    $data = preg_replace('/(youtube\.com.*)(\?feature=oembed)(.*)/', '$1?rel=0$3', $data);
    return $data;

    Hope that helps.

  3. mayday
    Posted 3 years ago #

    Your code update works for me on WP 3.5.1

  4. sparkweb
    Plugin Author

    Posted 3 years ago #

    @David, thanks so much for the fix on this. I've updated the plugin.

  5. teamcosmo
    Posted 3 years ago #

    I also cannot get the plugin to work. I activated the plugin, cleared the cache, yet there is no change to the YouTube video code. Here is what it looks like:
    <td>[lightbox type="youtube" title="Title" youtube_id="OYaY2XOEcKs"]<img class="alignnone size-medium wp-image-2942" title="United Way" src="http://www.miceliproductions.com/wpsite/wp-content/uploads/United-Way-300x214.jpg" alt="" width="243" height="172" />[/lightbox]</td>

    In you comment to mayhday, you reference changing the code - is that what I have to do? I am not used to working in the code.

  6. sparkweb
    Plugin Author

    Posted 3 years ago #

    This plugin has no effect on this usage. It only works when you are using oembed. Read about oembed here: http://codex.wordpress.org/Embeds#oEmbed

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.