Javascript 更新到WP 4.5后,Wordpress中出现Visual Composer错误
这是控制台出现错误的代码Javascript 更新到WP 4.5后,Wordpress中出现Visual Composer错误,javascript,wordpress,Javascript,Wordpress,这是控制台出现错误的代码 /** * Convert html into correct element * @param html */ html2element:function (html) { var attributes = {}, $template; if (_.isString(html)) { this.template = _.template(html);
/**
* Convert html into correct element
* @param html
*/
html2element:function (html) {
var attributes = {},
$template;
if (_.isString(html)) {
this.template = _.template(html);
$template = $(this.template(this.model.toJSON()).trim());
} else {
this.template = html;
$template = html;
}
_.each($template.get(0).attributes, function (attr) {
attributes[attr.name] = attr.value;
});
this.$el.attr(attributes).html($template.html());
this.setContent();
this.renderContent();
},
如果我违反了任何规则或没有详细解释问题,我会提前道歉
如果可能,请告知。请查看我的答案
我通过将html2element
函数更新为:
html2element: function(html) {
var $template, attributes = {},
template = html;
$template = $(template(this.model.toJSON()).trim()), _.each($template.get(0).attributes, function(attr) {
attributes[attr.name] = attr.value
}), this.$el.attr(attributes).html($template.html()), this.setContent(), this.renderContent()
},
在/wp content/plugins/js_composer/assets/js/backend/composer view.js
希望这对你有用 -此外,这不是PHP,所以请注意标记,这是Javascript。错误也可能与主题有关。您使用的主题是什么。下面提到的解决方案对我的情况没有帮助。我的解决方案是:删除VisualComposer插件(4.5.3)的捆绑安装,购买商业版(5版,成本:$35),然后安装该插件。感谢您花时间查看此内容!原来问题是主题过时了,所以我没有尝试你的解决方案!