Tablepress and Jquery Conflicts
-
I’ve noticed something strange I’m hoping you can help me with.
In trying to “do things the right way”, I’ve enqueued all my scripts and in that, have de-registered and registered my preferred Jquery library without double loading jquery, as follows:
wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js', array(), null, true );
Doing this hasn’t broken the functionality of Tablepress per se, because filtering options still work. However, I noticed that other plugins relying on Jquery – which work fine on pages without a Tablepress table – break on pages with a Tablepress table on it. So there is clearly some kind of conflict.
What I also noticed is that if I remove the line from above…
wp_deregister_script( 'jquery' )
…allowing WordPress to load its default JQuery library, that everything works fine again. That is less than ideal however, because then two instances of JQuery are being loaded. Looking at the source of the page, I see that JQuery 1.11.3 is being loaded (from …/wp-includes/js/jquery/jquery.js?ver=1.11.3), and when I deactivated Tablepress, that it wasn’t being loaded. So somehow, Tablepress is hooking into the default JQuery library and forcing it to load, despite my attempt to de-register it in my functions.php.
Help please?
- The topic ‘Tablepress and Jquery Conflicts’ is closed to new replies.