Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何在插件中使用wp post编辑器_Wordpress_Editor - Fatal编程技术网

Wordpress 如何在插件中使用wp post编辑器

Wordpress 如何在插件中使用wp post编辑器,wordpress,editor,Wordpress,Editor,我想在我正在开发的一个插件中使用wordpress的post编辑器。我应该如何将编辑器添加到插件中。最后,我想出了一种方法,在我的插件中添加微型mce编辑器 您必须添加一些脚本,wordpress的post编辑器将为您提供 这是要使用的代码: wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); wp_enqueue_script('utils'); if (function_exists('add_thickbo

我想在我正在开发的一个插件中使用wordpress的post编辑器。我应该如何将编辑器添加到插件中。

最后,我想出了一种方法,在我的插件中添加微型mce编辑器

您必须添加一些脚本,wordpress的post编辑器将为您提供

这是要使用的代码:

wp_enqueue_script( 'common' );
wp_enqueue_script( 'jquery-color' );
wp_enqueue_script('utils');
if (function_exists('add_thickbox')) add_thickbox();
wp_print_scripts('media-upload');
if (function_exists('wp_tiny_mce')) wp_tiny_mce();
wp_admin_css();
wp_print_scripts('editor');
do_action("admin_print_styles-post-php");
do_action('admin_print_styles');
在插件上添加微型mce编辑器就足够了

现在,显示编辑器需要以下行:

这是显示编辑器所必需的