-
-
Save hmorv/fd1c7c040e8ce1d1b35e to your computer and use it in GitHub Desktop.
Wordpress plugin for allow iframe in the visual Editor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: iFrame for TinyMCE | |
* Description: Allow iframe in the visual Editor | |
* Version: 0.0.1 | |
* Author: Frank Bültge | |
* Author URI: http://bueltge.de/ | |
*/ | |
! defined( 'ABSPATH' ) and exit; | |
add_filter( 'tiny_mce_before_init', 'fb_change_mce_options' ); | |
function fb_change_mce_options( $args ) { | |
// Comma separated string od extendes tags | |
// Command separated string of extended elements | |
$ext = 'iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]'; | |
if ( isset( $args['extended_valid_elements'] ) ) { | |
$args['extended_valid_elements'] .= ',' . $ext; | |
} else { | |
$args['extended_valid_elements'] = $ext; | |
} | |
// maybe; set tiny paramter verify_html | |
//$args['verify_html'] = false; | |
return $args; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment