Hide YouTube Related Videos

Περιγραφή

WordPress’ built-in oEmbed feature is fantastic. I’ve heard several complaints, though, about the related videos that show up after the video is done playing so I put together this very simple plugin that keeps the YouTube oEmbed code from showing related videos.

This plugin also adds wmode=transparent so that the flash object doesn’t overlap a modal window.

On activation, the plugin clears the oEmbed cache so that the videos can be successfully re-cached with the new setting. If you are upgrading the plugin, you may need to manually deactivate, then reactivate it to clear the cache.

Εγκατάσταση

Copy the folder to your WordPress
/wp-content/plugins/‘ folder.

  1. Ενεργοποιήστε το πρόσθετο μέσω του μενού «Πρόσθετα» στο WordPress
  2. That’s it. There’s nothing else to do. Really!

If you want to pass in some other parameters to the embedded url, you can do so with the hyrv_extra_querystring_parameters filter. Just make sure you end with an ampersand.

Add Something:

add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
function my_hyrv_extra_querystring_parameters($str) {
    return "wmode=transparent&MY_VAR_NAME=MY_VALUE&";
}

Remove the wmode=transparent:

add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
function my_hyrv_extra_querystring_parameters($str) {
    return "";
}

Be sure to leave an & at the end of your string. After installing your filter, be sure to deactivate and reactivate the plugin.

Συχνές Ερωτήσεις

Installation Instructions

Copy the folder to your WordPress
/wp-content/plugins/‘ folder.

  1. Ενεργοποιήστε το πρόσθετο μέσω του μενού «Πρόσθετα» στο WordPress
  2. That’s it. There’s nothing else to do. Really!

If you want to pass in some other parameters to the embedded url, you can do so with the hyrv_extra_querystring_parameters filter. Just make sure you end with an ampersand.

Add Something:

add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
function my_hyrv_extra_querystring_parameters($str) {
    return "wmode=transparent&MY_VAR_NAME=MY_VALUE&";
}

Remove the wmode=transparent:

add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
function my_hyrv_extra_querystring_parameters($str) {
    return "";
}

Be sure to leave an & at the end of your string. After installing your filter, be sure to deactivate and reactivate the plugin.

Κριτικές

works

it works the latest version of WordPress. very good plugins

Does what it says on the tin

Superb plugin! I wasted ages trying to find a way to block related YouTube videos to no avail… until I found this plugin. Which solved the problem instantly!
Super-easy to install and just works.

Still works!

Hasn’t been updated in a while, but it still does the trick. Great stuff and very useful!

Ανάγνωση όλων των 68 κριτικών

Συνεισφέροντες & Προγραμματιστές

“Hide YouTube Related Videos” είναι λογισμικό ανοιχτού κώδικα. Οι παρακάτω έχουν συνεισφέρει στη δημιουργία του.

Συντελεστές

Σύνοψη αλλαγών

1.4.2 (Jan 15, 2015)

  • Allow &autoplay=1 on the original url to be passed through to the oembed

1.4.1 (Sep 28, 2015)

  • Ease matching restrictions to allow more querystring elements to be passed through on original url

1.4 (Sep 24, 2015)

  • Added support for playlists, added clear cache button to plugin page

1.3 (Feb 10, 2014)

  • Disabled Jetpack YouTube shortcode embed as it kills this feature

1.2 (Feb 21, 2013)

  • Added wmode=transparent to the url structure

1.1 (Feb 11, 2013)

  • Updated to match YouTube’s new URL structure

1.0 (Dec 23, 2011)

  • Αρχική έκδοση