How to Stop WordPress Editor from Removing iFrame and Embed Code

AD

http://blogs.cooperhealth.org/?option=What-Indicators-Allow-To-Earn-On-Forex What Indicators Allow To Earn On Forex

here Binary Divergence Option Mt4 Trade Makes 425000

Best Business For Stay At Home Mom

here University Of Washington Investing In The Stock Market

Code:

function mytheme_tinymce_config( $init ) {
 $valid_iframe = 'iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
 if ( isset( $init['extended_valid_elements'] ) ) {
  $init['extended_valid_elements'] .= ',' . $valid_iframe;
 } else {
  $init['extended_valid_elements'] = $valid_iframe;
 }
 return $init;
}
add_filter('tiny_mce_before_init', 'mytheme_tinymce_config');

Let me know if that helps 🙂

Further Related Readings

Comments
  1. Toma May 28, 2011 at 2:02 am

    I haven’t tried it yet, but if this works a marriage proposal will be forthcoming.

    1. Tayyab May 28, 2011 at 12:15 pm

      This is the best comment I’ve seen so far on Designzzz. You Rock Toma!

    2. Ayaz Malik May 28, 2011 at 12:19 pm

      Thanks Toma!, Looking forward to hear from you if it worked or not as there is another way around it.

  2. Tobia June 24, 2011 at 7:27 am

    I tried but it works only admin profile.

    1. Ayaz Malik June 24, 2011 at 9:52 am

      Please make sure if its implemented properly. or see if you can see the vids fine on this page : http://www.designzzz.com/advanced-photoshop-cs5-video-tutorials/
      because we are using the same code to keep our videos 🙂

  3. Ayman August 25, 2011 at 3:22 am

    it worked with me, thanks Ayaz 🙂

  4. jerel September 22, 2011 at 8:30 pm

    thanks this worked a treat!!

  5. Nooooo April 3, 2013 at 7:43 am

    Does not work for allowing iframes in WordPress 3.5.1.

    There IS no folder wp-admin–>Appearance on my wp 3.5.1

Comments are closed.

Copyrights © 2016 - Designzzz. All Rights Reserved