Created
October 2, 2016 16:35
-
-
Save huiralb/e1710a8d6f278c3546b45b79a77133cf to your computer and use it in GitHub Desktop.
Fix Visual Composer 4.8 Uncaught TypeError: Cannot read property 'attributes' of undefined
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} |
Thanks for this!
Thanks working perfect...
[WP newbie here] Where should I put this function?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this! Worked like a treat 👍