iframe - Version 1.5.0

Version Description

  • Using native jQuery from include directory;
  • Improving "same_height_as" parameter;
Download this release

Release Info

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

Code changes from version 1.4.0 to 1.5.0

Files changed (2) hide show
  1. iframe.php +16 -11
  2. readme.txt +11 -7
iframe.php CHANGED
@@ -1,16 +1,21 @@
1
<?php
2
-
3
/*
4
Plugin Name: Iframe
5
Plugin URI: http://web-profile.com.ua/wordpress/plugins/iframe/
6
- Description: Plugin shows iframe with [iframe width="100%" height="480" src="http://player.vimeo.com/video/3261363"] shortcode.
7
- Version: 1.4.0
8
Author: webvitaly
9
Author Email: webvitaly(at)gmail.com
10
- Author URI: http://web-profile.com.ua/
11
*/
12
13
- if ( !function_exists( 'iframe_embed_shortcode' ) ) {
14
function iframe_embed_shortcode($atts, $content = null) {
15
extract(shortcode_atts(array(
16
'width' => '100%',
@@ -33,12 +38,11 @@ if ( !function_exists( 'iframe_embed_shortcode' ) ) {
33
}
34
$return = '';
35
if( $same_height_as != '' ){
36
- $return .= '<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>'; // including jQuery 1.6.x
37
$return .= '
38
- <script type="text/javascript">
39
- jQuery(document).ready(function() {
40
- var target_height = jQuery("'.$same_height_as.'").height();
41
- jQuery("iframe.'.$class.'").height(target_height);
42
});
43
</script>
44
';
@@ -53,4 +57,5 @@ if ( !function_exists( 'iframe_embed_shortcode' ) ) {
53
return $return;
54
}
55
add_shortcode('iframe', 'iframe_embed_shortcode');
56
- }
1
<?php
2
/*
3
Plugin Name: Iframe
4
Plugin URI: http://web-profile.com.ua/wordpress/plugins/iframe/
5
+ Description: Plugin shows iframe with [iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"] shortcode.
6
+ Version: 1.5.0
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' ) ) :
13
+
14
+ function iframe_enqueue_script() {
15
+ wp_enqueue_script( 'jquery' );
16
+ }
17
+ add_action('wp_enqueue_scripts', 'iframe_enqueue_script');
18
+
19
function iframe_embed_shortcode($atts, $content = null) {
20
extract(shortcode_atts(array(
21
'width' => '100%',
38
}
39
$return = '';
40
if( $same_height_as != '' ){
41
$return .= '
42
+ <script>
43
+ jQuery(document).ready(function($) {
44
+ var target_height = $("'.$same_height_as.'").height();
45
+ $("iframe.'.$class.'").height(target_height);
46
});
47
</script>
48
';
57
return $return;
58
}
59
add_shortcode('iframe', 'iframe_embed_shortcode');
60
+
61
+ endif;
readme.txt CHANGED
@@ -4,16 +4,16 @@ 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.2
8
- Stable tag: 1.4.0
9
10
- You can embed iframe with [iframe width="100%" height="480" src="http://vimeo.com/123"] 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
WordPress removes iframe when you switch from "HTML" to "Visual" tab because of the security reasons.
16
- So you can embed iframe code using this shortcode `[iframe width="100%" height="480" src="http://player.vimeo.com/video/3261363"]`.
17
18
= Usage (allowed parameters) =
19
* width - width of the iframe in pixels `[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%");
@@ -26,14 +26,18 @@ So you can embed iframe code using this shortcode `[iframe width="100%" height="
26
* allowtransparency - allows to set transparency of the iframe `[iframe allowtransparency="true" src="http://player.vimeo.com/video/3261363"]` (by default allowtransparency="true");
27
* id - allows to add the id of the iframe `[iframe id="my-id" src="http://player.vimeo.com/video/3261363"]` (by default id="");
28
* class - allowing to add the class of the iframe `[iframe class="my-class" src="http://player.vimeo.com/video/3261363"]` (by default class="iframe-class");
29
- * same_height_as - allows to set the height of iframe same as target element `[iframe same_height_as="body" src="http://player.vimeo.com/video/3261363"]` or `[iframe same_height_as="div.sidebar"]` or `[iframe same_height_as="div#content"]` (by default same_height_as="");
30
31
[Iframe plugin page](http://web-profile.com.ua/wordpress/plugins/iframe/)
32
33
- [WordPress stuff](http://web-profile.com.ua/wordpress/)
34
35
== Changelog ==
36
37
= 1.4.0 =
38
* Adding "same_height_as" parameter;
39
@@ -52,4 +56,4 @@ So you can embed iframe code using this shortcode `[iframe width="100%" height="
52
== Installation ==
53
54
1. Install plugin and activate it on the Plugins page;
55
- 2. Add shortcode `[iframe width="100%" height="480" src="http://player.vimeo.com/video/3261363"]` to page content;
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
8
+ Stable tag: 1.5.0
9
10
+ You can embed iframe with [iframe src="http://vimeo.com/123" 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
WordPress removes iframe when you switch from "HTML" to "Visual" tab because of the security reasons.
16
+ So you can embed iframe code using this shortcode `[iframe src="http://player.vimeo.com/video/3261363" width="100%" height="480"]`.
17
18
= Usage (allowed parameters) =
19
* width - width of the iframe in pixels `[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%");
26
* allowtransparency - allows to set transparency of the iframe `[iframe allowtransparency="true" src="http://player.vimeo.com/video/3261363"]` (by default allowtransparency="true");
27
* id - allows to add the id of the iframe `[iframe id="my-id" src="http://player.vimeo.com/video/3261363"]` (by default id="");
28
* class - allowing to add the class of the iframe `[iframe class="my-class" src="http://player.vimeo.com/video/3261363"]` (by default class="iframe-class");
29
+ * same_height_as - allows to set the height of iframe same as target element `[iframe same_height_as="body" src="http://player.vimeo.com/video/3261363"]`, `[iframe same_height_as="div.sidebar"]`, `[iframe same_height_as="div#content"]`, `[iframe same_height_as="window"]` - iframe will have the height of the viewport (visible area), `[iframe same_height_as="document"]` - iframe will have the height of the document (by default same_height_as="");
30
31
[Iframe plugin page](http://web-profile.com.ua/wordpress/plugins/iframe/)
32
33
+ [CMS WordPress](http://web-profile.com.ua/wordpress/)
34
35
== Changelog ==
36
37
+ = 1.5.0 =
38
+ * Using native jQuery from include directory;
39
+ * Improving "same_height_as" parameter;
40
+
41
= 1.4.0 =
42
* Adding "same_height_as" parameter;
43
56
== Installation ==
57
58
1. Install plugin and activate it on the Plugins page;
59
+ 2. Add shortcode `[iframe width="100%" height="480" src="http://player.vimeo.com/video/3261363"]` to page content;