wordpress 升級後 Visual Composer 壞掉 BUG 無法使用

wordpress 升級後 Visual Composer 壞掉 BUG 無法使用

找到 這段

html2element: function(html) {
    var $template, attributes = {},
    template = html;
	
    $template = $(template(this.model.toJSON()).trim());

    if($template.get(0)){
        _.each($template.get(0).attributes, function(attr) {
        attributes[attr.name] = attr.value
    })};
	
    this.$el.attr(attributes).html($template.html()),
    this.setContent(),
    this.renderContent()
},

改成以下這段

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()
        },

喔對了很重要,請用無痕模式打開一次,不然請確認快取重刷了,因為我是用無痕才OK,chrome快取跟本清不掉。

原文出處
https://stackoverflow.com/questions/36605420/plugin-throwing-typeerror-after-wordpress-4-5-update