iframe - Version 2.9

Version Description

  • 2014-05-31 =
  • remove '&' from the end of the string in 'get_params_from_url' param
Download this release

Release Info

Developer webvitaly
Plugin Icon wp plugin iframe
Version 2.9
Comparing to
See all releases

Code changes from version 2.8 to 2.9

Files changed (2) hide show
  1. iframe.php +20 -17
  2. readme.txt +10 -6
iframe.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: iframe
4
  Plugin URI: http://wordpress.org/plugins/iframe/
5
  Description: [iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
6
- Version: 2.8
7
  Author: webvitaly
8
  Author URI: http://web-profile.com.ua/wordpress/plugins/
9
  License: GPLv3
@@ -35,33 +35,35 @@ if ( ! function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
35
  }
36
 
37
  // get_params_from_url
38
- if( isset( $atts["get_params_from_url"] ) && ( $atts["get_params_from_url"] == '1' || $atts["get_params_from_url"] == 1 || $atts["get_params_from_url"] == 'true' ) ) {
39
- if( $_GET != NULL ){
40
- if( strpos( $atts["src"], '?' ) ){ // if we already have '?' and GET params
 
41
  $encode_string = '&';
42
- }else{
43
  $encode_string = '?';
44
  }
45
- foreach( $_GET as $key => $value ){
46
  $encode_string .= $key.'='.$value.'&';
47
  }
48
  }
 
49
  $atts["src"] .= $encode_string;
50
  }
51
 
52
  $html = '';
53
- if( isset( $atts["same_height_as"] ) ){
54
  $same_height_as = $atts["same_height_as"];
55
- }else{
56
  $same_height_as = '';
57
  }
58
 
59
- if( $same_height_as != '' ){
60
  $atts["same_height_as"] = '';
61
- if( $same_height_as != 'content' ){ // we are setting the height of the iframe like as target element
62
- if( $same_height_as == 'document' || $same_height_as == 'window' ){ // remove quotes for window or document selectors
63
  $target_selector = $same_height_as;
64
- }else{
65
  $target_selector = '"' . $same_height_as . '"';
66
  }
67
  $html .= '
@@ -72,7 +74,7 @@ if ( ! function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
72
  });
73
  </script>
74
  ';
75
- }else{ // set the actual height of the iframe (show all content of the iframe without scroll)
76
  $html .= '
77
  <script>
78
  jQuery(function($){
@@ -85,11 +87,11 @@ if ( ! function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
85
  ';
86
  }
87
  }
88
- $html .= "\n".'<!-- iframe plugin v.2.8 wordpress.org/plugins/iframe/ -->'."\n";
89
  $html .= '<iframe';
90
  foreach( $atts as $attr => $value ) {
91
- if( $attr != 'same_height_as' ){ // remove some attributes
92
- if( $value != '' ) { // adding all attributes
93
  $html .= ' ' . $attr . '="' . $value . '"';
94
  } else { // adding empty attributes
95
  $html .= ' ' . $attr;
@@ -106,9 +108,10 @@ if ( ! function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
106
  if ( strpos( $file, 'iframe.php' ) !== false ) {
107
  $links = array_merge( $links, array( '<a href="http://web-profile.com.ua/wordpress/plugins/iframe/" title="Plugin page">Iframe</a>' ) );
108
  $links = array_merge( $links, array( '<a href="http://web-profile.com.ua/donate/" title="Support the development">Donate</a>' ) );
 
109
  }
110
  return $links;
111
  }
112
  add_filter( 'plugin_row_meta', 'iframe_unqprfx_plugin_meta', 10, 2 );
113
 
114
- endif; // end of if(function_exists('iframe_unqprfx_embed_shortcode'))
3
  Plugin Name: iframe
4
  Plugin URI: http://wordpress.org/plugins/iframe/
5
  Description: [iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
6
+ Version: 2.9
7
  Author: webvitaly
8
  Author URI: http://web-profile.com.ua/wordpress/plugins/
9
  License: GPLv3
35
  }
36
 
37
  // get_params_from_url
38
+ if ( isset( $atts["get_params_from_url"] ) && ( $atts["get_params_from_url"] == '1' || $atts["get_params_from_url"] == 1 ) ) {
39
+ $encode_string = '';
40
+ if ( $_GET != NULL ) {
41
+ if ( strpos( $atts["src"], '?' ) ) { // if we already have '?' and GET params
42
  $encode_string = '&';
43
+ } else {
44
  $encode_string = '?';
45
  }
46
+ foreach( $_GET as $key => $value ) {
47
  $encode_string .= $key.'='.$value.'&';
48
  }
49
  }
50
+ $encode_string = rtrim($encode_string, '&'); // remove last '&'
51
  $atts["src"] .= $encode_string;
52
  }
53
 
54
  $html = '';
55
+ if ( isset( $atts["same_height_as"] ) ) {
56
  $same_height_as = $atts["same_height_as"];
57
+ } else {
58
  $same_height_as = '';
59
  }
60
 
61
+ if ( $same_height_as != '' ) {
62
  $atts["same_height_as"] = '';
63
+ if ( $same_height_as != 'content' ) { // we are setting the height of the iframe like as target element
64
+ if ( $same_height_as == 'document' || $same_height_as == 'window' ) { // remove quotes for window or document selectors
65
  $target_selector = $same_height_as;
66
+ } else {
67
  $target_selector = '"' . $same_height_as . '"';
68
  }
69
  $html .= '
74
  });
75
  </script>
76
  ';
77
+ } else { // set the actual height of the iframe (show all content of the iframe without scroll)
78
  $html .= '
79
  <script>
80
  jQuery(function($){
87
  ';
88
  }
89
  }
90
+ $html .= "\n".'<!-- iframe plugin v.2.9 wordpress.org/plugins/iframe/ -->'."\n";
91
  $html .= '<iframe';
92
  foreach( $atts as $attr => $value ) {
93
+ if ( $attr != 'same_height_as' ) { // remove some attributes
94
+ if ( $value != '' ) { // adding all attributes
95
  $html .= ' ' . $attr . '="' . $value . '"';
96
  } else { // adding empty attributes
97
  $html .= ' ' . $attr;
108
  if ( strpos( $file, 'iframe.php' ) !== false ) {
109
  $links = array_merge( $links, array( '<a href="http://web-profile.com.ua/wordpress/plugins/iframe/" title="Plugin page">Iframe</a>' ) );
110
  $links = array_merge( $links, array( '<a href="http://web-profile.com.ua/donate/" title="Support the development">Donate</a>' ) );
111
+ $links = array_merge( $links, array( '<a href="http://codecanyon.net/item/advanced-iframe-pro/5344999?ref=webvitaly">Advanced iFrame Pro</a>' ) );
112
  }
113
  return $links;
114
  }
115
  add_filter( 'plugin_row_meta', 'iframe_unqprfx_plugin_meta', 10, 2 );
116
 
117
+ endif; // end of (function_exists('iframe_unqprfx_embed_shortcode'))
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webvitaly
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: iframe, embed, youtube, vimeo, google-map, google-maps
5
  Requires at least: 3.0
6
- Tested up to: 3.9
7
- Stable tag: 2.8
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
@@ -12,9 +12,10 @@ License URI: http://www.gnu.org/licenses/gpl.html
12
 
13
  == Description ==
14
 
15
- **[iframe](http://web-profile.com.ua/wordpress/plugins/iframe/ "Plugin page")** |
16
- **[All iframe params](http://wordpress.org/plugins/iframe/other_notes/)** |
17
- **[Donate](http://web-profile.com.ua/donate/ "Support the development")**
 
18
 
19
  [iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
20
  should show something like this:
@@ -29,9 +30,9 @@ If you need to embed content from YouTube, Vimeo, SlideShare, SoundCloud, Twitte
29
  [embed] shortcode is a core WordPress feature and can [embed content from many resources via direct link](http://codex.wordpress.org/Embeds).
30
 
31
  = Useful: =
 
32
  * ["Anti-spam" - block spam in comments](http://wordpress.org/plugins/anti-spam/ "no spam, no captcha")
33
  * ["Page-list" - show list of pages with shortcodes](http://wordpress.org/plugins/page-list/ "list of pages with shortcodes")
34
- * ["Security-protection" - blocks brute-force attacks](http://wordpress.org/plugins/security-protection/ "stops brute-force attacks")
35
 
36
  == Other Notes ==
37
 
@@ -58,6 +59,9 @@ If you need to embed content from YouTube, Vimeo, SlideShare, SoundCloud, Twitte
58
 
59
  == Changelog ==
60
 
 
 
 
61
  = 2.8 - 2014-03-14 =
62
  * remove fix for google maps
63
 
3
  Donate link: http://web-profile.com.ua/donate/
4
  Tags: iframe, embed, youtube, vimeo, google-map, google-maps
5
  Requires at least: 3.0
6
+ Tested up to: 4.1
7
+ Stable tag: 2.9
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl.html
10
 
12
 
13
  == Description ==
14
 
15
+ > **[Advanced iFrame Pro](http://codecanyon.net/item/advanced-iframe-pro/5344999?ref=webvitaly)** |
16
+ > **[iframe](http://web-profile.com.ua/wordpress/plugins/iframe/ "Plugin page")** |
17
+ > **[All iframe params](http://wordpress.org/plugins/iframe/other_notes/)** |
18
+ > **[Donate](http://web-profile.com.ua/donate/ "Support the development")**
19
 
20
  [iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
21
  should show something like this:
30
  [embed] shortcode is a core WordPress feature and can [embed content from many resources via direct link](http://codex.wordpress.org/Embeds).
31
 
32
  = Useful: =
33
+ * [Advanced iFrame Pro](http://codecanyon.net/item/advanced-iframe-pro/5344999?ref=webvitaly)
34
  * ["Anti-spam" - block spam in comments](http://wordpress.org/plugins/anti-spam/ "no spam, no captcha")
35
  * ["Page-list" - show list of pages with shortcodes](http://wordpress.org/plugins/page-list/ "list of pages with shortcodes")
 
36
 
37
  == Other Notes ==
38
 
59
 
60
  == Changelog ==
61
 
62
+ = 2.9 - 2014-05-31 =
63
+ * remove '&' from the end of the string in 'get_params_from_url' param
64
+
65
  = 2.8 - 2014-03-14 =
66
  * remove fix for google maps
67