function GenerateIframe( $atts ) { extract( shortcode_atts( array( ‘href’ => ‘http://the-url’, ‘height’ => ‘550px’, ‘width’ => ‘600px’, ), $atts ) ); return ‘<iframe src=”‘.$href.'” width=”‘.$width.'” height=”‘.$height.'”> <p>Your Browser does not support Iframes.</p></iframe>’; } add_shortcode(‘iframe’, ‘GenerateIframe’); // how to use: [iframe href=”http://www.exmaple.com” height=”480″ width=”640″]
Articles Tagged: iFrame
Make WordPress Editor Allow iFrames
// make TinyMCE allow iframes add_filter(‘tiny_mce_before_init’, create_function( ‘$a’, ‘$a[“extended_valid_elements”] = “iframe[id|class|title|style|align| frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]”; return $a;’) );