Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I need to embed an iFrame into a post and it appears that tinyMCE or something is stripping it out when I go from HTML to Visual view while editing a post.

I've found instructions for adding valid elements to tinyMCE but it only seems to apply to WordPress 2.8. No such file seems to exist under WordPress 3.0.1 (see Make WordPress WYSIWYG not strip out iframe's)

None of the iFrame embedding plugins seem to support WP 3.0.1 either.

Thanks for any tips.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

Did you try this solution: http://wordpress.stackexchange.com/questions/3041/make-wordpress-wysiwyg-not-strip-out-iframes/3067#3067?

share|improve this answer
    
That seems to have done the trick - must have missed this part - thanks! Just had to paste the following before the function to make it show up as a plugin: <?php /* Plugin Name: Change tinyMCE Options */ –  cpuguru Oct 29 '10 at 21:01
add comment

Copy paste this code in your functions.php :

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

This will add a filter to tinymce editor. Working on WP 3.xx

share|improve this answer
add comment

I use tinymce advanced plugin which has the option to not strip iframes in the settings panel.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.