Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试在单个页面中添加多个 wp_editor() 并显示,但是当我尝试添加媒体时,媒体按钮不起作用,我将选项(drag_drop_upload 为 true)添加到 wp_editor 选项以进行拖放并且其工作.
但是当我拖放图像时,所有图像都插入到第一个 wp_editor 实例中。即使我尝试在第二个或第三个 wp_editor 中拖放,但它再次显示在第一个编辑器中。
是否有任何解决方案可以通过上传或拖放到特定的 wp_editor 实例来插入媒体?
谢谢
添加多个 wp_editor 实例的简单方法是为新创建的元素“重新初始化”插件!
tinymce.init({ selector: '#' + editor_id});
创建新元素后,只需初始化该元素的tinymce。
希望这对某人有所帮助。