Мой хостинг-провайдер автоматически обновлялся до версии 4.5 и приводил к ошибке с плагином Visual Composer.Ошибка плагина после обновления Wordpress
Я прочитал эти посты: Plugin throwing TypeError after Wordpress 4.5 update
Visual composer doesn't load and gives TypeError: _.template(...).trim is not a function
Uncaught TypeError: $template.get is not a function
И заменил функцию html2element с поставкой. Однако, так как многие люди прокомментировали эти посты, я получаю новую ошибку:
composer-view.js?ver=4.6.1:139 Uncaught TypeError: Cannot read property 'attributes' of undefined
Вот моя функция:
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()
},
кажется ошибка, приходит из этой линии:
$template.get(0).attributes
Кто-нибудь понял, как это исправить?
Спасибо за вашу помощь
Работал отлично –
Спасибо, это работает – Cagdas
вы спасатель жизни! – Amir