问题描述
我注意到更新到WP 5.5之后,我无法通过PageLines5编辑wordpress页面。
Uncaught ReferenceError: wp is not defined at color-picker.min.js:2
Uncaught TypeError: a(...).wpColorPicker is not a function at editing.js:5
“启用jQuery迁移帮助器”插件对我没有帮助。
解决方法
女主角更新后,页面编辑器(Pagelines框架)无法编辑,因为a(...).wpColorPicker is not a function at editing.js
团体脚本
解决方案: 在wp-content / plugins / pl-platform / engine / ui / js / edit.js中查看文件edit.js 解压缩文件后,最后进行编辑 之前:
.each(function () {
a(this)
.wpColorPicker({
change: function (b,c) {
var d = a(this);
d.val(d.iris("color")).trigger("keyup");
var e = _.debounce(
function () {
d.trigger("blur");
},300,{ leading: !1 }
);
e();
},})
.addClass("is-ready loaded");
})
...
})
代替(添加... hasOwnProperty('wpColorPicker')
.each(function () {
if(a(this).hasOwnProperty('wpColorPicker')) {
a(this)
.wpColorPicker({
change: function (b,c) {
var d = a(this);
d.val(d.iris("color")).trigger("keyup");
var e = _.debounce(
function () {
d.trigger("blur");
},{ leading: !1 }
);
e();
},})
.addClass("is-ready loaded");
}
})
...
})
刷新页面以确保文件已更新,我建议删除已完成的缓存浏览器。 对我有用