我正在使用以下代码生成与默认WordPress设置不同的TinyMCE栏:
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);
}
有人能告诉我如何在那里使用基本的自定义按钮吗?我所需要的只是一个简单的按钮,它将[ph\\u min]打印到编辑器区域。
我尝试过使用以下过滤器,但没有效果:
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\');
是否有任何方法可以做到这一点,或者我必须使用编写一个WP不支持的手动TinyMCE init?