首页 > 解决方案 > WordPress 与 PageLines 冲突

问题描述

我注意到更新到 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 迁移助手”对我没有帮助。

标签: wordpresspagelineswordpress-5.5

解决方案


wordress 更新后,页面编辑器(Pagelines 框架)无法编辑,因为a(...).wpColorPicker is not a function at editing.jsbloc 脚本

解决方案:查看 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");
                    },
                    300,
                    { leading: !1 }
                );
                e();
            },
        })
        .addClass("is-ready loaded");
    }
})
...

})

刷新您的页面确保您的文件已更新,我建议删除缓存浏览器完成。它对我有用


推荐阅读