说明:在chrome下面,编辑文章插入的图片,点击到图片上面,没有菜单显示。
报错:
tinymce.min.js:10 Uncaught DOMException: Failed to execute 'setBaseAndExtent' on 'Selection': There is no child at offset 1.
at B.<anonymous> (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:10:7658)
at t.i [as fire] (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:8:14427)
at B.fire (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:8:16322)
at p.s (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:10:15645)
at e (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:2:12478)
at HTMLHtmlElement.m (https://sternerstuffdesign.com/wp/wp-includes/js/tinymce/tinymce.min.js?ver=4403-20160901:2:12818)
原因:这个是tinymce的bug,详情请看链接:wordpress论坛,git上面的tinymce的issues
解决思路:1)chrome下面编辑文章图片的时候,选中图片,左右稍微拖动,菜单就会出现。(这是最直接有效的方法)
2)下载wordpress最新版,将/wp-includes/js/tinymce下的目录copy一份到你的wordpress项目的同样目录下面,进行替换