Changeset 2464704
- Timestamp:
- 01/29/2021 06:55:51 AM (5 years ago)
- Location:
- iframe-me/trunk
- Files:
-
- 4 added
- 2 edited
-
iframe-me.php (modified) (3 diffs)
-
includes (added)
-
includes/class-iframe-me-exception.php (added)
-
includes/class-iframe-me-renderer.php (added)
-
includes/functions.php (added)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
iframe-me/trunk/iframe-me.php
r2460535 r2464704 3 3 * Plugin Name: iFrame Me 4 4 * Description: A simple solution for inserting iFrames. 5 * Version: 1. 0.05 * Version: 1.1.0 6 6 * Author: soysudhanshu 7 7 * Author URI: https://soysudhanshu.com 8 * Requires PHP: 7.4 9 * Requires at least: 5.3 8 10 */ 11 12 if(!defined('ABSPATH')){ 13 exit(''); 14 } 15 16 require __DIR__ . '/includes/class-iframe-me-exception.php'; 17 require __DIR__ . '/includes/class-iframe-me-renderer.php'; 18 require __DIR__ . '/includes/functions.php'; 9 19 10 20 add_shortcode('iframe_me', 'render_iframe_me_shortcode'); … … 12 22 function render_iframe_me_shortcode($attributes, $content) 13 23 { 14 $allowed_protocols = ['http', 'https']; 15 $url = esc_url($content, $allowed_protocols); 24 $url = $content; 25 if(empty($attributes)){ 26 $attributes = []; 27 } 16 28 17 if (empty($url)) { 18 return <<<HTML 19 <div style='color:tomato; 29 try{ 30 31 $iframe_renderer = new Iframe_Me_Renderer($url, $attributes); 32 $output = $iframe_renderer->output(); 33 }catch(Iframe_Me_Exception $e){ 34 $output = "<div style='color:tomato; 20 35 padding: 1rem; 21 36 border-radius:7px; … … 23 38 background: white' 24 39 > 25 Invalid iFrame URL 26 </div> 27 HTML; 40 {$e->getMessage()} 41 </div>"; 28 42 } 29 43 30 return "<iframe src='$url' height='500'></iframe>";44 return $output; 31 45 } -
iframe-me/trunk/readme.txt
r2460535 r2464704 1 1 === iFrame Me === 2 2 Contributors: soysudhanshu 3 Tags: iframe, embed, simple, iframe 4 Requires at least: 5.0 3 Tags: iframe, embed, simple iframe, iframe me, external, content 5 4 Tested up to: 5.6 5 Requires at least: 5.3 6 6 Requires PHP: 7.4 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html 7 8 License: GPL v2 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html9 9 10 Easily add iframe with a simple shortcode 10 Easily add iframe with a simple shortcode. 11 11 [iframe_me]https://example.com[/iframe_me] 12 12 13 13 == Description == 14 Add iFrames without writing any HTML! 14 iFrame Me is a simple plugin for creating HTML iFrames which serve as window to another site for displaying embedded content 15 16 == How to use == 17 Simply write shortcode and add url between.`[iframe_me] YOUR URL [/iframe_me]` 18 19 = Shortcode Params = 20 You can use these codes to customize iframe. Uses `[iframe_me height='100px'...` . 21 * *height* Height of output frame in pixels or percentage. 22 * *width* width of output frame in pixels or percentage. 23 15 24 16 25 == Changelog == 17 == 1.0.0 == 26 = 1.1.0 = 27 * Custom iframe height and width support. 28 * Added Relative URL support. 29 30 = 1.0.0 = 18 31 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.