Version Description
- 2013-03-18 =
- minor changes
Download this release
Release Info
Developer | webvitaly |
Plugin | iframe |
Version | 2.6 |
Comparing to | |
See all releases |
Code changes from version 2.5 to 2.6
- iframe.php +21 -21
- readme.txt +19 -13
iframe.php
CHANGED
@@ -2,24 +2,24 @@
|
|
2 |
/*
|
3 |
Plugin Name: iframe
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/iframe/
|
5 |
-
Description: [iframe src="http://
|
6 |
-
Version: 2.
|
7 |
Author: webvitaly
|
8 |
-
Author URI: http://
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
12 |
|
13 |
-
if ( !function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
|
14 |
|
15 |
function iframe_unqprfx_enqueue_script() {
|
16 |
wp_enqueue_script( 'jquery' );
|
17 |
}
|
18 |
-
add_action('wp_enqueue_scripts', 'iframe_unqprfx_enqueue_script');
|
19 |
|
20 |
-
function iframe_unqprfx_embed_shortcode($atts, $content = null) {
|
21 |
$defaults = array(
|
22 |
-
'src' => 'http://
|
23 |
'width' => '100%',
|
24 |
'height' => '480',
|
25 |
'scrolling' => 'no',
|
@@ -27,8 +27,8 @@ if ( !function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
|
|
27 |
'frameborder' => '0'
|
28 |
);
|
29 |
|
30 |
-
foreach ($defaults as $default => $value) { // add defaults
|
31 |
-
if (
|
32 |
$atts[$default] = $value;
|
33 |
}
|
34 |
}
|
@@ -90,9 +90,9 @@ if ( !function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
|
|
90 |
';
|
91 |
}
|
92 |
}
|
93 |
-
$html .= "\n".'<!-- iframe plugin v.2.
|
94 |
$html .= '<iframe';
|
95 |
-
foreach
|
96 |
if( $attr != 'same_height_as' ){ // remove some attributes
|
97 |
if( $value != '' ) { // adding all attributes
|
98 |
$html .= ' ' . $attr . '="' . $value . '"';
|
@@ -104,16 +104,16 @@ if ( !function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
|
|
104 |
$html .= '></iframe>';
|
105 |
return $html;
|
106 |
}
|
107 |
-
add_shortcode('iframe', 'iframe_unqprfx_embed_shortcode');
|
108 |
|
109 |
-
endif;
|
110 |
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
116 |
}
|
117 |
-
|
118 |
-
|
119 |
-
|
2 |
/*
|
3 |
Plugin Name: iframe
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/iframe/
|
5 |
+
Description: [iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
|
6 |
+
Version: 2.6
|
7 |
Author: webvitaly
|
8 |
+
Author URI: http://web-profile.com.ua/wordpress/plugins/
|
9 |
License: GPLv2 or later
|
10 |
*/
|
11 |
|
12 |
|
13 |
+
if ( ! function_exists( 'iframe_unqprfx_embed_shortcode' ) ) :
|
14 |
|
15 |
function iframe_unqprfx_enqueue_script() {
|
16 |
wp_enqueue_script( 'jquery' );
|
17 |
}
|
18 |
+
add_action( 'wp_enqueue_scripts', 'iframe_unqprfx_enqueue_script' );
|
19 |
|
20 |
+
function iframe_unqprfx_embed_shortcode( $atts, $content = null ) {
|
21 |
$defaults = array(
|
22 |
+
'src' => 'http://www.youtube.com/embed/A3PDXmYoF5U',
|
23 |
'width' => '100%',
|
24 |
'height' => '480',
|
25 |
'scrolling' => 'no',
|
27 |
'frameborder' => '0'
|
28 |
);
|
29 |
|
30 |
+
foreach ( $defaults as $default => $value ) { // add defaults
|
31 |
+
if ( ! @array_key_exists( $default, $atts ) ) { // hide warning with "@" when no params at all
|
32 |
$atts[$default] = $value;
|
33 |
}
|
34 |
}
|
90 |
';
|
91 |
}
|
92 |
}
|
93 |
+
$html .= "\n".'<!-- iframe plugin v.2.6 wordpress.org/extend/plugins/iframe/ -->'."\n";
|
94 |
$html .= '<iframe';
|
95 |
+
foreach( $atts as $attr => $value ) {
|
96 |
if( $attr != 'same_height_as' ){ // remove some attributes
|
97 |
if( $value != '' ) { // adding all attributes
|
98 |
$html .= ' ' . $attr . '="' . $value . '"';
|
104 |
$html .= '></iframe>';
|
105 |
return $html;
|
106 |
}
|
107 |
+
add_shortcode( 'iframe', 'iframe_unqprfx_embed_shortcode' );
|
108 |
|
|
|
109 |
|
110 |
+
function iframe_unqprfx_plugin_meta( $links, $file ) { // add 'Plugin page' and 'Donate' links to plugin meta row
|
111 |
+
if ( strpos( $file, 'iframe.php' ) !== false ) {
|
112 |
+
$links = array_merge( $links, array( '<a href="http://web-profile.com.ua/wordpress/plugins/iframe/" title="Plugin page">' . __('Iframe') . '</a>' ) );
|
113 |
+
$links = array_merge( $links, array( '<a href="http://web-profile.com.ua/donate/" title="Support the development">' . __('Donate') . '</a>' ) );
|
114 |
+
}
|
115 |
+
return $links;
|
116 |
}
|
117 |
+
add_filter( 'plugin_row_meta', 'iframe_unqprfx_plugin_meta', 10, 2 );
|
118 |
+
|
119 |
+
endif; // end of if(function_exists('iframe_unqprfx_embed_shortcode'))
|
readme.txt
CHANGED
@@ -3,34 +3,37 @@ 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.5
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
-
[iframe src="http://
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
-
|
|
|
|
|
16 |
|
17 |
-
|
18 |
|
19 |
-
|
20 |
|
21 |
-
|
|
|
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 |
* ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/ "sanitize filenames to latin")
|
27 |
|
28 |
== Other Notes ==
|
29 |
|
30 |
= Iframe params: =
|
31 |
-
* **src** - source of the iframe `[iframe src="http://
|
32 |
-
* **width** - width in pixels or in percents `[iframe width="100%" src="http://
|
33 |
-
* **height** - height in pixels `[iframe height="480" src="http://
|
34 |
* **scrolling** - parameter `[iframe scrolling="yes"]` (by default scrolling="no");
|
35 |
* **frameborder** - parameter `[iframe frameborder="0"]` (by default frameborder="0");
|
36 |
* **marginheight** - parameter `[iframe marginheight="0"]` (removed by default);
|
@@ -50,6 +53,9 @@ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/819138"
|
|
50 |
|
51 |
== Changelog ==
|
52 |
|
|
|
|
|
|
|
53 |
= 2.5 - 2012-11-03 =
|
54 |
* added 'get_params_from_url' (thanks to Nathanael Majoros)
|
55 |
|
@@ -58,7 +64,7 @@ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/819138"
|
|
58 |
|
59 |
= 2.3 - 2012.09.09 =
|
60 |
* small fixes
|
61 |
-
* added (src="http://
|
62 |
|
63 |
= 2.2 =
|
64 |
* fixed bug (Notice: Undefined index: same_height_as)
|
@@ -103,4 +109,4 @@ Embed iframe using shortcode `[iframe src="http://player.vimeo.com/video/819138"
|
|
103 |
== Installation ==
|
104 |
|
105 |
1. install and activate the plugin on the Plugins page
|
106 |
-
2. add shortcode `[iframe src="http://
|
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.5.1
|
7 |
+
Stable tag: 2.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
+
[iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"] shortcode
|
12 |
|
13 |
== Description ==
|
14 |
|
15 |
+
**[iframe](http://web-profile.com.ua/wordpress/plugins/iframe/ "Plugin page")** |
|
16 |
+
**[All iframe params](http://wordpress.org/extend/plugins/iframe/other_notes/)** |
|
17 |
+
**[Donate](http://web-profile.com.ua/donate/ "Support the development")**
|
18 |
|
19 |
+
Use iframe to embed video from YouTube or Vimeo or to embed Google Map or just to embed content from external page.
|
20 |
|
21 |
+
Embed iframe using shortcode `[iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"]`
|
22 |
|
23 |
+
You also can use this shortcode to embed content via simple link: `[embed]http://www.youtube.com/watch?v=A3PDXmYoF5U[/embed]`
|
24 |
+
[embed] shortcode is a WordPress core feature and based on [oEmbed](http://codex.wordpress.org/Embeds).
|
25 |
|
26 |
= Useful plugins: =
|
|
|
27 |
* ["Anti-spam" - block spam in comments](http://wordpress.org/extend/plugins/anti-spam/ "no spam, no captcha")
|
28 |
+
* ["Page-list" - show list of pages with shortcodes](http://wordpress.org/extend/plugins/page-list/ "list of pages with shortcodes")
|
29 |
* ["Filenames to latin" - sanitize filenames to latin during upload](http://wordpress.org/extend/plugins/filenames-to-latin/ "sanitize filenames to latin")
|
30 |
|
31 |
== Other Notes ==
|
32 |
|
33 |
= Iframe params: =
|
34 |
+
* **src** - source of the iframe `[iframe src="http://www.youtube.com/embed/A3PDXmYoF5U"]` (by default src="http://www.youtube.com/embed/A3PDXmYoF5U");
|
35 |
+
* **width** - width in pixels or in percents `[iframe width="100%" src="http://www.youtube.com/embed/A3PDXmYoF5U"]` or `[iframe width="640" src="http://www.youtube.com/embed/A3PDXmYoF5U"]` (by default width="100%");
|
36 |
+
* **height** - height in pixels `[iframe height="480" src="http://www.youtube.com/embed/A3PDXmYoF5U"]` (by default height="480");
|
37 |
* **scrolling** - parameter `[iframe scrolling="yes"]` (by default scrolling="no");
|
38 |
* **frameborder** - parameter `[iframe frameborder="0"]` (by default frameborder="0");
|
39 |
* **marginheight** - parameter `[iframe marginheight="0"]` (removed by default);
|
53 |
|
54 |
== Changelog ==
|
55 |
|
56 |
+
= 2.6 - 2013-03-18 =
|
57 |
+
* minor changes
|
58 |
+
|
59 |
= 2.5 - 2012-11-03 =
|
60 |
* added 'get_params_from_url' (thanks to Nathanael Majoros)
|
61 |
|
64 |
|
65 |
= 2.3 - 2012.09.09 =
|
66 |
* small fixes
|
67 |
+
* added (src="http://www.youtube.com/embed/A3PDXmYoF5U") by default
|
68 |
|
69 |
= 2.2 =
|
70 |
* fixed bug (Notice: Undefined index: same_height_as)
|
109 |
== Installation ==
|
110 |
|
111 |
1. install and activate the plugin on the Plugins page
|
112 |
+
2. add shortcode `[iframe src="http://www.youtube.com/embed/A3PDXmYoF5U" width="100%" height="480"]` to page or post content
|