当我使用名为 WpBakery Visual Composer 的插件时,我在 WordPress 中遇到此错误。
我正在使用最新版本的 WordPress (4.5),使用最新的 Google Chrome 版本并且所有插件都已更新。我似乎无法使用 Visual Composer 添加任何元素或模板。
有人可以帮助我或告诉我可能发生的情况以及如何解决此错误。
我得到的错误:
最佳答案
请看我的回答here.
我通过将 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
或者在 wp-content/plugins/js_composer/assets/js/dist/backend.min.js`
希望这对你有用!
关于javascript - Uncaught TypeError : $template. get 不是一个函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36641618/