Skip to content
Advertisement

jQuery Collapse function throws error on upgrade of WordPress and PHP

I have upgraded an old WordPress site to the latest WordPress. PHP version was also upgraded. The site had a custom sidebar menu where opening and closing was controlled with a custom.js script. The menu no longer toggles.

After the upgrade the following error appeared in the console:

Uncaught TypeError: $submenu.collapse is not a function.

Not quite sure what the issue is.

JavaScript

Advertisement

Answer

Collapse is a bootstrap function. The boostrap in the old theme, the dependency was not properly done.

Before Fix

JavaScript

After Fix

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement