在执行ajax调用后,我遇到了同样的问题,并发现在初始化编辑器之前,如果我们已经在php中初始化了编辑器,那么我们需要删除编辑器调用,然后只需要初始化编辑器
wp.editor.remove(editorID);
wp.editor.initialize(editorID, {
tinymce: {
wpautop: true,
plugins : \'charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern\',
toolbar1: \'formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons\',
toolbar2: \'styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help\',
textarea_rows : 20
},
quicktags: {buttons: \'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close\'},
mediaButtons: false,
});