3
基本上需要默認的Wordpress TinyMCE
所見即所得的編輯器,用戶將在我的插件中輸入一些格式化的文本。如何在簡單的HTML Wordpress格式中集成/實現TinyMCE
?我想在我的Wordpress插件中實現TinyMCE。怎麼樣?
我使用Wordpress v2.9!
基本上需要默認的Wordpress TinyMCE
所見即所得的編輯器,用戶將在我的插件中輸入一些格式化的文本。如何在簡單的HTML Wordpress格式中集成/實現TinyMCE
?我想在我的Wordpress插件中實現TinyMCE。怎麼樣?
我使用Wordpress v2.9!
您正在尋找的功能是wp_tiny_mce
。以下是如何在您的插件的管理面板中包含編輯器。
包括在admin_head
鉤
add_filter('admin_head','zd_multilang_tinymce');
function zd_multilang_tinymce() {
wp_admin_css('thickbox');
wp_print_scripts('jquery-ui-core');
wp_print_scripts('jquery-ui-tabs');
wp_print_scripts('post');
wp_print_scripts('editor');
add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
// use the if condition because this function doesn't exist in version prior to 2.7
}
調用編輯器的任何地方,你需要用它來顯示
the_editor($content_to_load);
可能重複這樣的代碼: http://stackoverflow.com/questions/2855890/add-tinymce-to-wordpress-plugin – cregox 2011-03-12 21:54:30