Ajout de boutons personnalisés TinyMCE lors de l'utilisation de teeny_mce_before_init
Question
J'utilise le code suivant pour produire une barre TinyMCE différente à la configuration WordPress par défaut:
if (function_exists('wp_tiny_mce')) {
add_filter("mce_external_plugins", "add_myplugin_tinymce_plugin");
add_filter('mce_buttons', 'register_myplugin_button');
add_filter('teeny_mce_before_init', create_function('$a', '
$a["theme"] = "advanced";
$a["skin"] = "wp_theme";
$a["height"] = "75";
$a["width"] = "800";
$a["onpageload"] = "";
$a["mode"] = "exact";
$a["elements"] = "elm1, elm2";
$a["editor_selector"] = "mceEditor";
$a["plugins"] = "safari,inlinepopups,spellchecker";
$a["forced_root_block"] = false;
$a["force_br_newlines"] = true;
$a["force_p_newlines"] = false;
$a["convert_newlines_to_brs"] = true;
return $a;'));
wp_tiny_mce(true);
}
Quelqu'un peut-il me dire comment travailler un bouton personnalisé de base là-dedans?
Tout ce dont j'ai besoin est un bouton simple qui imprime [ph_min] dans la zone de l'éditeur.
J'ai essayé d'utiliser les filtres suivants en vain:
function register_tcustom_button($buttons)
{
array_push($buttons, "|", "highlight");
return $buttons;
}
function add_tcustom_tinymce_plugin($plugin_array)
{
$plugin_array['highlight'] = WP_PLUGIN_URL . '/sf-tinyMCE-custom-buttons/mce/min_max_buttons/editor_plugin.js';
return $plugin_array;
}
add_filter("mce_external_plugins", "add_tcustom_tinymce_plugin");
add_filter('mce_buttons', 'register_tcustom_button');
Existe-t-il un moyen de le faire, ou devrai-je utiliser l'écriture d'une init manuelle TinyMCE qui n'est pas prise en charge par WP?
Pas de solution correcte
Licencié sous: CC-BY-SA avec attribution
Non affilié à wordpress.stackexchange