Hide YouTube Related Videos - Version 1.3

Version Description

(Feb 10, 2014) = Disabled Jetpack YouTube shortcode embed as it kills this feature

Download this release

Release Info

Developer sparkweb
Plugin Icon 128x128 Hide YouTube Related Videos
Version 1.3
Comparing to
See all releases

Code changes from version 1.2 to 1.3

Files changed (2) hide show
  1. hide-youtube-related-videos.php +15 -3
  2. readme.txt +9 -4
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.2
8
  Author URI: http://www.soapboxdave.com/
9
 
10
  **************************************************************************
@@ -28,12 +28,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
  **************************************************************************/
29
 
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
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  //On Activation, all oembed caches are cleared
39
  register_activation_hook(__FILE__, 'hide_youtube_related_videos_activation');
@@ -52,4 +64,4 @@ function hide_youtube_related_videos_activation() {
52
  return true;
53
  }
54
 
55
- }
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.3
8
  Author URI: http://www.soapboxdave.com/
9
 
10
  **************************************************************************
28
  **************************************************************************/
29
 
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
 
37
+ //Disable the Jetpack
38
+ function hyrv_remove_jetpack_shortcode_function( $shortcodes ) {
39
+ $jetpack_shortcodes_dir = WP_CONTENT_DIR . '/plugins/jetpack/modules/shortcodes/';
40
+ $shortcodes_to_unload = array('youtube.php');
41
+ foreach ( $shortcodes_to_unload as $shortcode ) {
42
+ if ( $key = array_search( $jetpack_shortcodes_dir . $shortcode, $shortcodes ) ) {
43
+ unset( $shortcodes[$key] );
44
+ }
45
+ }
46
+ return $shortcodes;
47
+ }
48
+ add_filter('jetpack_shortcodes_to_include', 'hyrv_remove_jetpack_shortcode_function');
49
 
50
  //On Activation, all oembed caches are cleared
51
  register_activation_hook(__FILE__, 'hide_youtube_related_videos_activation');
64
  return true;
65
  }
66
 
67
+ }
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: 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 ==
@@ -39,9 +39,14 @@ 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
 
@@ -54,5 +59,5 @@ Added wmode=transparent to the url structure
54
 
55
  == Upgrade Notice ==
56
 
57
- = 1.2 =
58
- Added wmode=transparent to the embedded url
2
  Contributors: sparkweb
3
  Tags: youtube, video, oembed, related
4
  Requires at least: 2.9
5
+ Tested up to: 4.3
6
+ Stable tag: 1.3
7
  This is a simple plugin to keep the YouTube oEmbed from showing related videos.
8
 
9
  == Description ==
39
  return "";
40
  }`
41
 
42
+ Be sure to leave an & at the end of your string. After installing your filter, be sure to deactivate and reactivate the plugin.
43
+
44
 
45
  == Changelog ==
46
 
47
+ = 1.3 (Feb 10, 2014) =
48
+ Disabled Jetpack YouTube shortcode embed as it kills this feature
49
+
50
  = 1.2 (Feb 21, 2013) =
51
  Added wmode=transparent to the url structure
52
 
59
 
60
  == Upgrade Notice ==
61
 
62
+ = 1.3 =
63
+ Disabled Jetpack YouTube shortcode embed as it kills this feature