MWDelaney / bootstrap-3-shortcodes

WordPress shortcodes for easier use of Bootstrap elements in your content.
https://wordpress.org/plugins/bootstrap-3-shortcodes/
MIT License
377 stars 118 forks source link

Uncaught TypeError: #144

Closed KevinBatdorf closed 6 years ago

KevinBatdorf commented 7 years ago

Uncaught TypeError: jQuery(...).removeAttr(...).nextUntil(...).andSelf is not a function

Happens on custom admin pages. It's from this code:

jQuery('#bootstrap-shortcodes-help h2').each(function(){
    var id = jQuery(this).attr("id");
    jQuery(this).removeAttr("id").nextUntil("h2").andSelf().wrapAll('<div class="tab-pane" id="bs-' + id + '" />');
});
MWDelaney commented 6 years ago

Replying a year later. Better late than never? Probably to?

If you're using a non-WordPress-default version of jQuery for your site you could run into this error, as andSelf() is deprecated in newer versions.

audioscavenger commented 6 years ago

just replace andSelf by addBack that's it. andSelf() function has been deprecated and is now an alias for .addBack(), which should be used with jQuery 1.8 and later.