Wordpress - Autoriser les iframes dans tinymce

June 1, 2011
L'éditeur de Wordpress, tinyMCE, supprime les tags des iframes. Cette mesure, mise en place par soucis de sécurité, peut être gênante. C'est pourquoi il existe une manipulation à faire permettant de supprimer cette contrainte.   Il suffit d'ajouter dans le fichier function.php de votre admin (dans l'admin, Apparence->Editeur->Fonctions du thème):   [sourcecode language="php"] 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'); [/sourcecode]  
Une question? Une remarque? Un avis? Twittons-en!

When you click on links to various merchants on this site and make a purchase, this can result in this site earning a commission.
Affiliate programs and affiliations include, but are not limited to, the eBay Partner Network and Amazon.