Uncaught TypeError: $template.get is not a function

后端 未结 8 1276
遥遥无期
遥遥无期 2020-12-24 01:28

I am getting this error in WordPress when I am using a plugin called WpBakery Visual Composer.

I am using the latest version of WordPress (4.5), using the latest Go

8条回答
  •  伪装坚强ぢ
    2020-12-24 02:00

    Please see my answer here.

    I fixed this bug by updating the html2element function to:

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

    in /wp-content/plugins/js_composer/assets/js/backend/composer-view.js

    or in wp-content/plugins/js_composer/assets/js/dist/backend.min.js`

    Hope this works for you!

提交回复
热议问题