Version Description
(Feb 21, 2013) = Added wmode=transparent to the url structure
Download this release
Release Info
Developer | sparkweb |
Plugin | Hide YouTube Related Videos |
Version | 1.2 |
Comparing to | |
See all releases |
Code changes from version 1.1 to 1.2
- hide-youtube-related-videos.php +2 -2
- readme.txt +26 -5
hide-youtube-related-videos.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Hide YouTube Related Videos
|
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/hide-youtube-related-videos/
|
5 |
Description: This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
6 |
Author: SparkWeb Interactive, Inc.
|
7 |
-
Version: 1.
|
8 |
Author URI: http://www.soapboxdave.com/
|
9 |
|
10 |
**************************************************************************
|
@@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
30 |
//The Filter That Does the Work
|
31 |
add_filter( 'oembed_result', 'hide_youtube_related_videos', 10, 3);
|
32 |
function hide_youtube_related_videos($data, $url, $args = array()) {
|
33 |
-
$data = preg_replace('/(youtube\.com.*)(\?feature=oembed)(.*)/', '$1?rel=0$3', $data);
|
34 |
return $data;
|
35 |
}
|
36 |
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/hide-youtube-related-videos/
|
5 |
Description: This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
6 |
Author: SparkWeb Interactive, Inc.
|
7 |
+
Version: 1.2
|
8 |
Author URI: http://www.soapboxdave.com/
|
9 |
|
10 |
**************************************************************************
|
30 |
//The Filter That Does the Work
|
31 |
add_filter( 'oembed_result', 'hide_youtube_related_videos', 10, 3);
|
32 |
function hide_youtube_related_videos($data, $url, $args = array()) {
|
33 |
+
$data = preg_replace('/(youtube\.com.*)(\?feature=oembed)(.*)/', '$1?' . apply_filters("hyrv_extra_querystring_parameters", "wmode=transparent&") . 'rel=0$3', $data);
|
34 |
return $data;
|
35 |
}
|
36 |
|
readme.txt
CHANGED
@@ -2,15 +2,17 @@
|
|
2 |
Contributors: sparkweb
|
3 |
Tags: youtube, video, oembed, related
|
4 |
Requires at least: 2.9
|
5 |
-
Tested up to: 3.
|
6 |
-
Stable tag: 1.
|
7 |
This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
8 |
|
9 |
== Description ==
|
10 |
|
11 |
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.
|
12 |
|
13 |
-
|
|
|
|
|
14 |
|
15 |
== Installation ==
|
16 |
|
@@ -20,10 +22,29 @@ Copy the folder to your WordPress
|
|
20 |
1. Activate the plugin in your WordPress admin
|
21 |
1. That's it. There's nothing else to do. Really!
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
== Changelog ==
|
26 |
|
|
|
|
|
|
|
27 |
= 1.1 (Feb 11, 2013) =
|
28 |
* Updated to match YouTube's new URL structure
|
29 |
|
@@ -33,5 +54,5 @@ Copy the folder to your WordPress
|
|
33 |
|
34 |
== Upgrade Notice ==
|
35 |
|
36 |
-
= 1.
|
37 |
-
|
2 |
Contributors: sparkweb
|
3 |
Tags: youtube, video, oembed, related
|
4 |
Requires at least: 2.9
|
5 |
+
Tested up to: 3.8.1
|
6 |
+
Stable tag: 1.2
|
7 |
This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
8 |
|
9 |
== Description ==
|
10 |
|
11 |
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.
|
12 |
|
13 |
+
This plugin also adds wmode=transparent so that the flash object doesn't overlap a modal window.
|
14 |
+
|
15 |
+
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.
|
16 |
|
17 |
== Installation ==
|
18 |
|
22 |
1. Activate the plugin in your WordPress admin
|
23 |
1. That's it. There's nothing else to do. Really!
|
24 |
|
25 |
+
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.
|
26 |
+
|
27 |
+
Add Something:
|
28 |
+
|
29 |
+
`add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
|
30 |
+
function my_hyrv_extra_querystring_parameters($str) {
|
31 |
+
return "wmode=transparent&MY_VAR_NAME=MY_VALUE&";
|
32 |
+
}`
|
33 |
+
|
34 |
+
|
35 |
+
Remove the wmode=transparent:
|
36 |
+
|
37 |
+
`add_filter("hyrv_extra_querystring_parameters", "my_hyrv_extra_querystring_parameters");
|
38 |
+
function my_hyrv_extra_querystring_parameters($str) {
|
39 |
+
return "";
|
40 |
+
}`
|
41 |
|
42 |
|
43 |
== Changelog ==
|
44 |
|
45 |
+
= 1.2 (Feb 21, 2013) =
|
46 |
+
Added wmode=transparent to the url structure
|
47 |
+
|
48 |
= 1.1 (Feb 11, 2013) =
|
49 |
* Updated to match YouTube's new URL structure
|
50 |
|
54 |
|
55 |
== Upgrade Notice ==
|
56 |
|
57 |
+
= 1.2 =
|
58 |
+
Added wmode=transparent to the embedded url
|