Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<?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;
  }
?>