Version Description
(Jan 15, 2015) =
* Allow &autoplay=1
on the original url to be passed through to the oembed
Download this release
Release Info
Developer | sparkweb |
Plugin | Hide YouTube Related Videos |
Version | 1.4.2 |
Comparing to | |
See all releases |
Code changes from version 1.4.1 to 1.4.2
- hide-youtube-related-videos.php +6 -3
- readme.txt +10 -7
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.4.
|
8 |
Author URI: http://www.soapboxdave.com/
|
9 |
|
10 |
**************************************************************************
|
@@ -31,16 +31,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
31 |
add_filter('oembed_result', 'hide_youtube_related_videos', 10, 3);
|
32 |
function hide_youtube_related_videos($data, $url, $args = array()) {
|
33 |
|
|
|
|
|
|
|
34 |
//Setup the string to inject into the url
|
35 |
$str_to_add = apply_filters("hyrv_extra_querystring_parameters", "wmode=transparent&") . 'rel=0';
|
36 |
|
37 |
//Regular oembed
|
38 |
if (strpos($data, "feature=oembed") !== false) {
|
39 |
-
$data = str_replace('feature=oembed', $str_to_add . '&feature=oembed', $data);
|
40 |
|
41 |
//Playlist
|
42 |
} elseif (strpos($data, "list=") !== false) {
|
43 |
-
$data = str_replace('list=', $str_to_add . '&list=', $data);
|
44 |
}
|
45 |
|
46 |
//All Set
|
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.4.2
|
8 |
Author URI: http://www.soapboxdave.com/
|
9 |
|
10 |
**************************************************************************
|
31 |
add_filter('oembed_result', 'hide_youtube_related_videos', 10, 3);
|
32 |
function hide_youtube_related_videos($data, $url, $args = array()) {
|
33 |
|
34 |
+
//Autoplay
|
35 |
+
$autoplay = strpos($url, "autoplay=1") !== false ? "&autoplay=1" : "";
|
36 |
+
|
37 |
//Setup the string to inject into the url
|
38 |
$str_to_add = apply_filters("hyrv_extra_querystring_parameters", "wmode=transparent&") . 'rel=0';
|
39 |
|
40 |
//Regular oembed
|
41 |
if (strpos($data, "feature=oembed") !== false) {
|
42 |
+
$data = str_replace('feature=oembed', $str_to_add . $autoplay . '&feature=oembed', $data);
|
43 |
|
44 |
//Playlist
|
45 |
} elseif (strpos($data, "list=") !== false) {
|
46 |
+
$data = str_replace('list=', $str_to_add . $autoplay . '&list=', $data);
|
47 |
}
|
48 |
|
49 |
//All Set
|
readme.txt
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
Contributors: sparkweb
|
3 |
Tags: youtube, video, oembed, related
|
4 |
Requires at least: 2.9
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: 1.4.
|
7 |
This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
8 |
|
9 |
== Description ==
|
@@ -43,9 +43,12 @@ Be sure to leave an & at the end of your string. After installing your filte
|
|
43 |
|
44 |
|
45 |
== Changelog ==
|
46 |
-
|
47 |
-
= 1.4.
|
48 |
-
*
|
|
|
|
|
|
|
49 |
|
50 |
= 1.4 (Sep 24, 2015) =
|
51 |
* Added support for playlists, added clear cache button to plugin page
|
@@ -65,5 +68,5 @@ Be sure to leave an & at the end of your string. After installing your filte
|
|
65 |
|
66 |
== Upgrade Notice ==
|
67 |
|
68 |
-
= 1.4.
|
69 |
-
|
2 |
Contributors: sparkweb
|
3 |
Tags: youtube, video, oembed, related
|
4 |
Requires at least: 2.9
|
5 |
+
Tested up to: 4.7
|
6 |
+
Stable tag: 1.4.2
|
7 |
This is a simple plugin to keep the YouTube oEmbed from showing related videos.
|
8 |
|
9 |
== Description ==
|
43 |
|
44 |
|
45 |
== Changelog ==
|
46 |
+
|
47 |
+
= 1.4.2 (Jan 15, 2015) =
|
48 |
+
* Allow `&autoplay=1` on the original url to be passed through to the oembed
|
49 |
+
|
50 |
+
= 1.4.1 (Sep 28, 2015) =
|
51 |
+
* Ease matching restrictions to allow more querystring elements to be passed through on original url
|
52 |
|
53 |
= 1.4 (Sep 24, 2015) =
|
54 |
* Added support for playlists, added clear cache button to plugin page
|
68 |
|
69 |
== Upgrade Notice ==
|
70 |
|
71 |
+
= 1.4.2 =
|
72 |
+
Allow `&autoplay=1` on the original url to be passed through to the oembed
|