YouTube Embed - Version 1.4.2

Version Description

  • Fixed bug which meant that people upgrading from previous versions may not be able to display video until they've been to the options screen and re-saved their default options

=

Download this release

Release Info

Developer dartiss
Plugin Icon 128x128 YouTube Embed
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (3) hide show
  1. readme.txt +11 -3
  2. youtube-embed-options.php +11 -1
  3. youtube-embed.php +10 -3
readme.txt CHANGED
@@ -2,14 +2,16 @@
2
  Contributors: dartiss
3
  Donate link: http://artiss.co.uk/donate
4
  Tags: YouTube, embed, XHTML, video, playlist, thumbnail, EmbedPlus, widget, shortcode
5
- Requires at least: 2.0
6
  Tested up to: 3.1
7
- Stable tag: 1.4.1
8
 
9
  YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
10
 
11
  == Description ==
12
 
 
 
13
  YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
14
 
15
  It works with all the current YouTube API parameters, including HD video, and produces XHTML valid output. It also, unlike many other similar plugins, works with videos with certain characters within their ID (e.g. double dashes).
@@ -267,6 +269,9 @@ It has been tested and been found valid from PHP 4 upwards.
267
  = 1.4.1 =
268
  * HD option is available with EmbedPlus - updated the admin and widget screen to reflect this
269
 
 
 
 
270
  == Upgrade Notice ==
271
 
272
  = 1.0 =
@@ -288,4 +293,7 @@ It has been tested and been found valid from PHP 4 upwards.
288
  * Update to add EmbedPlus, multi-widgets and transcript output capabilities
289
 
290
  = 1.4.1 =
291
- * Upgrade to make a small correction to the parameter lists
 
 
 
2
  Contributors: dartiss
3
  Donate link: http://artiss.co.uk/donate
4
  Tags: YouTube, embed, XHTML, video, playlist, thumbnail, EmbedPlus, widget, shortcode
5
+ Requires at least: 2.8
6
  Tested up to: 3.1
7
+ Stable tag: 1.4.2
8
 
9
  YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
10
 
11
  == Description ==
12
 
13
+ **If you have upgraded an existing version of this plugin to 1.4 or 1.4.1 or above you may find that your videos no longer appear. To resolve this please download 1.4.2 or above.**
14
+
15
  YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
16
 
17
  It works with all the current YouTube API parameters, including HD video, and produces XHTML valid output. It also, unlike many other similar plugins, works with videos with certain characters within their ID (e.g. double dashes).
269
  = 1.4.1 =
270
  * HD option is available with EmbedPlus - updated the admin and widget screen to reflect this
271
 
272
+ = 1.4.2 =
273
+ * Fixed bug which meant that people upgrading from previous versions may not be able to display video until they've been to the options screen and re-saved their default options
274
+
275
  == Upgrade Notice ==
276
 
277
  = 1.0 =
293
  * Update to add EmbedPlus, multi-widgets and transcript output capabilities
294
 
295
  = 1.4.1 =
296
+ * Upgrade to make a small correction to the parameter lists
297
+
298
+ = 1.4.2 =
299
+ * Upgrade is you upgraded to version 1.4 or 1.4.1 from a previous version, to fix an important bug
youtube-embed-options.php CHANGED
@@ -28,12 +28,22 @@ if(!empty($_POST['Submit'])) {
28
  $options['type']=$_POST['youtube_embed_type'];
29
  update_option("youtube_embed",$options);
30
  }
 
31
  // Fetch options into an array
32
  $options=get_option("youtube_embed");
 
33
  // Set defaults if no array is defined
34
  if (!is_array($options)) {
35
  echo "<div class=\"updated\"><p><strong>Please review the default options below and click \"Save Settings\" to update them.</strong></p></div>\n";
36
- $options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1','link'=>'1','react'=>'1','stop'=>'0','sweetspot'=>'1','type'=>'v');}
 
 
 
 
 
 
 
 
37
  ?>
38
 
39
  <a href="http://embedplus.com/"><img src="<?php echo WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); ?>embedplus.png" alt="EmbedPlus" title="EmbedPlus" align="right" /></a>
28
  $options['type']=$_POST['youtube_embed_type'];
29
  update_option("youtube_embed",$options);
30
  }
31
+
32
  // Fetch options into an array
33
  $options=get_option("youtube_embed");
34
+
35
  // Set defaults if no array is defined
36
  if (!is_array($options)) {
37
  echo "<div class=\"updated\"><p><strong>Please review the default options below and click \"Save Settings\" to update them.</strong></p></div>\n";
38
+ $options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1','link'=>'1','react'=>'1','stop'=>'0','sweetspot'=>'1','type'=>'v');
39
+ }
40
+
41
+ // Set default values for new options, if missing
42
+ if ($options['link']=="") {$options['link']='1';}
43
+ if ($options['react']=="") {$options['react']='1';}
44
+ if ($options['stop']=="") {$options['stop']='0';}
45
+ if ($options['sweetspot']=="") {$options['sweetspot']='1';}
46
+ if ($options['type']=="") {$options['type']='v';}
47
  ?>
48
 
49
  <a href="http://embedplus.com/"><img src="<?php echo WP_PLUGIN_URL.'/'.str_replace(basename( __FILE__),"",plugin_basename(__FILE__)); ?>embedplus.png" alt="EmbedPlus" title="EmbedPlus" align="right" /></a>
youtube-embed.php CHANGED
@@ -3,11 +3,11 @@
3
  Plugin Name: YouTube Embed
4
  Plugin URI: http://www.artiss.co.uk/youtube-embed
5
  Description: Embed YouTube Videos in WordPress
6
- Version: 1.4.1
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
10
- define('youtube_embed_version','1.4.1');
11
 
12
  // Set up WordPress shortcodes and actions
13
  add_shortcode('youtube','youtube_video_sc');
@@ -207,7 +207,7 @@ function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$au
207
  // Get default values if no values are supplied
208
  $options=get_option("youtube_embed");
209
  if (!is_array($options)) {
210
- $options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1','link'=>'1','react'=>'1','stop'=>'0','sweetspot'=>'1','type'=>'0');
211
  }
212
  if ($width=="") {$width=$options['width'];}
213
  if ($height=="") {$height=$options['height'];}
@@ -231,6 +231,13 @@ function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$au
231
  if ($stop=="") {$stop=$options['stop'];}
232
  if ($sweetspot=="") {$sweetspot=$options['sweetspot'];}
233
  if ($type=="") {$type=$options['type'];}
 
 
 
 
 
 
 
234
 
235
  // Set up EmbedPlus
236
  if ($type=="m") {
3
  Plugin Name: YouTube Embed
4
  Plugin URI: http://www.artiss.co.uk/youtube-embed
5
  Description: Embed YouTube Videos in WordPress
6
+ Version: 1.4.2
7
  Author: David Artiss
8
  Author URI: http://www.artiss.co.uk
9
  */
10
+ define('youtube_embed_version','1.4.2');
11
 
12
  // Set up WordPress shortcodes and actions
13
  add_shortcode('youtube','youtube_video_sc');
207
  // Get default values if no values are supplied
208
  $options=get_option("youtube_embed");
209
  if (!is_array($options)) {
210
+ $options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1','link'=>'1','react'=>'1','stop'=>'0','sweetspot'=>'1','type'=>'v');
211
  }
212
  if ($width=="") {$width=$options['width'];}
213
  if ($height=="") {$height=$options['height'];}
231
  if ($stop=="") {$stop=$options['stop'];}
232
  if ($sweetspot=="") {$sweetspot=$options['sweetspot'];}
233
  if ($type=="") {$type=$options['type'];}
234
+
235
+ // Set default values for new options, if missing
236
+ if ($link=="") {$link='1';}
237
+ if ($react=="") {$react='1';}
238
+ if ($stop=="") {$stop='0';}
239
+ if ($sweetspot=="") {$sweetspot='1';}
240
+ if ($type=="") {$type='v';}
241
 
242
  // Set up EmbedPlus
243
  if ($type=="m") {