Support iframes in editor

Adding this to the functions.php of your wordpress theme will allow you to add iframes to the tinymce editor.

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;') );

Comments  Leave a Reply

  1. Cliff Paulick July 20, 2011 at 4:45 am

    Is there a reason this isn’t part of the WP core?

    1. You know to be honest I’m not sure,

  2. Tweets that mention Wordpress Support iframes in editor – wpsnipp.com Wordpress code snippets for your blog -- Topsy.com January 24, 2011 at 3:36 pm

    […] This post was mentioned on Twitter by wp_freak, WPSNIPP. WPSNIPP said: #wordpress Support iframes in editor http://bit.ly/eRGLxu #blog please RT 🙂 […]

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!