iframe - Version 2.3

Version Description

  • 2012.09.09 =
  • small fixes
  • added (src="http://player.vimeo.com/video/819138") by default
Download this release

Release Info

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

Code changes from version 2.2 to 2.3

Files changed (3) hide show
  1. iframe.php +11 -10
  2. readme.txt +29 -19
  3. screenshot-1.png +0 -0
iframe.php CHANGED
@@ -1,12 +1,12 @@
1
<?php
2
/*
3
- Plugin Name: [iframe]
4
Plugin URI: http://web-profile.com.ua/wordpress/plugins/iframe/
5
- Description: [iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"] shortcode
6
- Version: 2.2
7
Author: webvitaly
8
- Author Email: webvitaly(at)gmail.com
9
Author URI: http://web-profile.com.ua/wordpress/
10
*/
11
12
if ( !function_exists( 'iframe_embed_shortcode' ) ) :
@@ -18,20 +18,21 @@ if ( !function_exists( 'iframe_embed_shortcode' ) ) :
18
19
function iframe_embed_shortcode($atts, $content = null) {
20
$defaults = array(
21
'width' => '100%',
22
'height' => '480',
23
'scrolling' => 'no',
24
'class' => 'iframe-class',
25
'frameborder' => '0'
26
);
27
- // add defaults
28
- foreach ($defaults as $default => $value) {
29
- if (!array_key_exists($default, $atts)) {
30
$atts[$default] = $value;
31
}
32
}
33
- // special case maps
34
- $src_cut = substr($atts["src"], 0, 35);
35
if(strpos($src_cut, 'maps.google' )){
36
$atts["src"] .= '&output=embed';
37
}
@@ -72,7 +73,7 @@ if ( !function_exists( 'iframe_embed_shortcode' ) ) :
72
';
73
}
74
}
75
- $html .= "\n".'<!-- Iframe plugin v.2.2 (wordpress.org/extend/plugins/iframe/) -->'."\n";
76
$html .= '<iframe';
77
foreach ($atts as $attr => $value) {
78
if( $attr != 'same_height_as' ){ // remove some attributes
1
<?php
2
/*
3
+ Plugin Name: iframe
4
Plugin URI: http://web-profile.com.ua/wordpress/plugins/iframe/
5
+ Description: [iframe src="http://player.vimeo.com/video/819138" width="100%" height="480"] shortcode
6
+ Version: 2.3
7
Author: webvitaly
8
Author URI: http://web-profile.com.ua/wordpress/
9
+ License: GPLv2 or later
10
*/
11
12
if ( !function_exists( 'iframe_embed_shortcode' ) ) :
18
19
function iframe_embed_shortcode($atts, $content = null) {
20
$defaults = array(
21
+ 'src' => 'http://player.vimeo.com/video/819138',
22
'width' => '100%',
23
'height' => '480',
24
'scrolling' => 'no',
25
'class' => 'iframe-class',
26
'frameborder' => '0'
27
);
28
+
29
+ foreach ($defaults as $default => $value) { // add defaults
30
+ if (!@array_key_exists($default, $atts)) { // hide warning with "@" when no params at all
31
$atts[$default] = $value;
32
}
33
}
34
+
35
+ $src_cut = substr($atts["src"], 0, 35); // special case maps
36
if(strpos($src_cut, 'maps.google' )){
37
$atts["src"] .= '&output=embed';
38
}
73
';
74
}
75
}
76
+ $html .= "\n".'<!-- iframe plugin v:2.3 - wordpress.org/extend/plugins/iframe/ -->'."\n";
77
$html .= '<iframe';
78
foreach ($atts as $attr => $value) {
79
if( $attr != 'same_height_as' ){ // remove some attributes
readme.txt CHANGED
@@ -1,35 +1,37 @@
1
- === [iframe] ===
2
Contributors: webvitaly
3
- Plugin URI: http://web-profile.com.ua/wordpress/plugins/iframe/
4
Tags: iframe, embed, youtube, vimeo, google-map, google-maps
5
- Author URI: http://web-profile.com.ua/wordpress/
6
Requires at least: 3.0
7
- Tested up to: 3.3.1
8
- Stable tag: 2.2
9
10
- [iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"] shortcode
11
12
== Description ==
13
14
- Iframes are needed to embed video from youtube or to embed Google Map or just to embed content from external page.
15
16
- Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"]`
17
18
- [All Iframe params](http://wordpress.org/extend/plugins/iframe/other_notes/)
19
20
- [Iframe plugin page](http://web-profile.com.ua/wordpress/plugins/iframe/)
21
22
- = Try other useful plugins: =
23
- * [Page-list](http://wordpress.org/extend/plugins/page-list/) - show list of pages with shortcodes
24
- * [Login Logout](http://wordpress.org/extend/plugins/login-logout/) - default Meta widget replacement
25
- * [Filenames to latin](http://wordpress.org/extend/plugins/filenames-to-latin/) - sanitize filenames to latin during upload
26
27
== Other Notes ==
28
29
= Iframe params: =
30
- * **src** - source of the iframe `[iframe src="http://player.vimeo.com/video/3261363"]` (empty by default src="");
31
- * **width** - width in pixels or in percents `[iframe width="100%" src="http://player.vimeo.com/video/3261363"]` or `[iframe width="640" src="http://player.vimeo.com/video/3261363"]` (by default width="100%");
32
- * **height** - height in pixels `[iframe height="480" src="http://player.vimeo.com/video/3261363"]` (by default height="480");
33
* **scrolling** - parameter `[iframe scrolling="yes"]` (by default scrolling="no");
34
* **frameborder** - parameter `[iframe frameborder="0"]` (by default frameborder="0");
35
* **marginheight** - parameter `[iframe marginheight="0"]` (removed by default);
@@ -42,8 +44,16 @@ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/3261363
42
* **any_other_param** - allows to add new parameter of the iframe `[iframe any_other_param="any_value"]`;
43
* **any_other_empty_param** - allows to add new empty parameter of the iframe (like "allowfullscreen" on youtube) `[iframe any_other_empty_param=""]`;
44
45
== Changelog ==
46
47
= 2.2 =
48
* fixed bug (Notice: Undefined index: same_height_as)
49
@@ -86,5 +96,5 @@ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/3261363
86
87
== Installation ==
88
89
- 1. Install and activate the plugin on the Plugins page
90
- 2. Add shortcode `[iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"]` to page or post content
1
+ === iframe ===
2
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.4.2
7
+ Stable tag: 2.3
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
11
+ [iframe src="http://player.vimeo.com/video/819138" width="100%" height="480"] shortcode
12
13
== Description ==
14
15
+ Use iframe to embed video from YouTube or Vimeo or to embed Google Map or just to embed content from external page.
16
17
+ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/819138" width="100%" height="480"]`
18
19
+ [All iframe params](http://wordpress.org/extend/plugins/iframe/other_notes/)
20
21
+ [iframe plugin page](http://web-profile.com.ua/wordpress/plugins/iframe/)
22
23
+ = Useful plugins: =
24
+ * ["Page-list" - show list of pages with shortcodes](http://wordpress.org/extend/plugins/page-list/ "list of pages with shortcodes")
25
+ * ["Anti-spam" - block spam in comments](http://wordpress.org/extend/plugins/anti-spam/ "no spam, no captcha")
26
+ * ["Login-Logout" - default Meta widget replacement](http://wordpress.org/extend/plugins/login-logout/ "default Meta widget replacement")
27
+ * ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/ "sanitize filenames to latin")
28
29
== Other Notes ==
30
31
= Iframe params: =
32
+ * **src** - source of the iframe `[iframe src="http://player.vimeo.com/video/819138"]` (by default src="http://player.vimeo.com/video/819138");
33
+ * **width** - width in pixels or in percents `[iframe width="100%" src="http://player.vimeo.com/video/819138"]` or `[iframe width="640" src="http://player.vimeo.com/video/819138"]` (by default width="100%");
34
+ * **height** - height in pixels `[iframe height="480" src="http://player.vimeo.com/video/819138"]` (by default height="480");
35
* **scrolling** - parameter `[iframe scrolling="yes"]` (by default scrolling="no");
36
* **frameborder** - parameter `[iframe frameborder="0"]` (by default frameborder="0");
37
* **marginheight** - parameter `[iframe marginheight="0"]` (removed by default);
44
* **any_other_param** - allows to add new parameter of the iframe `[iframe any_other_param="any_value"]`;
45
* **any_other_empty_param** - allows to add new empty parameter of the iframe (like "allowfullscreen" on youtube) `[iframe any_other_empty_param=""]`;
46
47
+ == Screenshots ==
48
+
49
+ 1. [iframe] shortcode
50
+
51
== Changelog ==
52
53
+ = 2.3 - 2012.09.09 =
54
+ * small fixes
55
+ * added (src="http://player.vimeo.com/video/819138") by default
56
+
57
= 2.2 =
58
* fixed bug (Notice: Undefined index: same_height_as)
59
96
97
== Installation ==
98
99
+ 1. install and activate the plugin on the Plugins page
100
+ 2. add shortcode `[iframe src="http://player.vimeo.com/video/819138" width="100%" height="480"]` to page or post content
screenshot-1.png ADDED
Binary file