<?php
/* Plugin Name: Allow iframes
Plugin URI: http://www.topspinmedia.com/
Description: Allow iframes to be added to blog posts and site pages
Version: 1.0
Author: Topspin Media
Author URI: http://www.topspinmedia.com/
*/
// This filter will prevent TinyMCE from removing iframe elements.
isset($teeny) && $teeny ? add_filter('teeny_mce_before_init',
'allowiframes') : add_filter('tiny_mce_before_init', 'allowiframes');
// There are a few things you can do with TinyMCE here, so let's allow
extensibility.
function allowiframes($options)
{
isset($options['extended_valid_elements'])
? $options['extended_valid_elements'] .= ',iframe[height|width|src|
style|frameborder|title]'
: $options['extended_valid_elements'] = 'iframe[height|width|src|
style|frameborder|title]';
return $options;
}
?>