The two versions of jQuery are massively different. Many methods that were available in 1.12.* have been deprecated or removed in version 3.*. Sounds like Slimemenu needs the latest jQuery.
Also, the jQuery that WordPress loads in by default uses noConflict to jQuery instead of $. So if your trying to instantiate a plugin and using
$(document).ready(function() {
$('#whatever').someMethod(); //this will fail, you need to use
})
//This will work if your plugin is compatible with version 1.12.*
jQuery(document).ready(function($) {
$('#whatever').someMethod();
})
I’d look into one of the two items I listed above.
Slimmenu doesn’t use either of those methods, it just goes right into the function. Anyway I found another issue with the WP core version too, my Advanced Custom Fields plugin doesn’t work the old version either. Even though I’m using if (! is_admin) to load the CDN version of jQuery, it seems that if I don’t deregister the core version in my functions file, ACF breaks too.
Sounds like WordPress needs to update to the latest jQuery so people like me don’t have to keep loading a CDN version. I don’t really care, I was just hoping to get rid of those lines in my code and also stop worrying about that DEBUGGING notice on the login page (about deregister). It’s only there when I’m debugging so doesn’t matter, but just a thought.
You can replace the core jQuery with a new version in a plugin or in your theme functions.php. You have to be absolutely sure there is no code using the legacy jQuery and take this into account whenever installing new plugins/themes. This is kind of bordering on bad practices but it’s the solution I would go with. That said here’s a snippet
//Making jQuery Google API
function modify_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js', false, '3.4.1');
wp_enqueue_script('jquery');
}
add_action('init', 'modify_jquery');
You may replace the jQuery CDN with your own. Credit to WPBeginner the script snippet.
Yes that’s the code I’ve always used in my themes, and thanks 🙂