【问题标题】:WordPress conflicting with PageLinesWordPress 与 PageLines 冲突
【发布时间】:2020-12-03 11:27:46
【问题描述】:

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

【问题讨论】:

  • 可能不兼容/冲突的 jQuery 版本?但是这里确实没有足够的信息来提供帮助。

标签: wordpress pagelines wordpress-5.5


【解决方案1】:

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

解决方案: 查看 wp-content/plugins/pl-platform/engine/ui/js/edit.js 中的文件 edit.js 之后 unminify 一个文件,最后进行编辑 之前:

.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");
    }
})
...

})

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-06-18
    • 2012-07-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多