Bonjour,
Je dev un site sous wordpress et je suis entrain d'ajouter des format à tiny. Le problème est le suivant quand je met mon curseur sur la ligne ou meme quand je surligne un mot il me change toute la partie en les balises.
Exemple:
<p>Convenit lasciviam perfecta licentia tamquam.</p>
Je met mon curseur sur le mot perfecta puis j'ajoute mon format voici le resultat :<p><span class="bleu">Convenit lasciviam perfecta licentia tamquam.</span></p>
J'arrive au meme résultat si je surligne le mot.
Voici mon code qui me permet d'ajouter le formats.
// Register our callback to the appropriate filter add_filter('mce_buttons_2', 'my_mce_buttons_2'); function my_mce_before_init_insert_formats( $init_array ) { // Define the style_formats array $style_formats = array( // Each array child is a format with it's own settings array( 'title' => 'texte en bleu', 'block' => 'span', 'classes' => 'bleu', 'wrapper' => true,
) ); // Insert the array, JSON ENCODED, into 'style_formats' $init_array['style_formats'] = json_encode( $style_formats );
return $init_array;
} // Attach callback to 'tiny_mce_before_init' add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );