• Hello Everyone,

    We are facing an issue with lower version of jQuery included in WordPress. We found the hook to implement latest jQuery in front-end of WordPress, however there is no way to include latest jQuery in WP Admin area except replacing the jquery.js file at /wp-includes/js/jquery.

    Is there a way to achieve this without modifying WP Core files?

    If we use the hook admin_enqueue_scripts it includes latest jQuery below the load-scripts.php file and shows error of dependency.

    Any help would be appreciated. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi Nikhil

    You can indeed add your own version of jQuery without modifying the core code (never do this). To do this use the following code – https://codepad.org/A2seaiS7 in your functions.php

    If you aren’t confident editing theme files then there are plugins such as jQuery version control which enables this feature too.

    Thread Starter Nikhil Ranpara

    (@nikhilranpara-1)

    Hello Garethgillman,

    Thanks for your quick response. The code mentioned at https://codepad.org/A2seaiS7 will change the jQuery version for WordPress front-end site i.e. https://www.MYWEBSITE.com. However, it won’t change jQuery version in WordPress admin area i.e. https://www.MYWEBSITE.com/wp-admin/

    There is a hook admin_enqueue_scripts similar to wp_enqueue_scripts for admin area but admin behaves differently than front-end website. It has technique to load all the scripts in load-scripts.php file as per the need on specific page. Here, admin_enqueue_scripts adds the new version jquery below the load-scripts.php file which has already loaded other jQuery dependent scripts such as UI, Sorting, Widgets, etc… Therefore it is showing jQuery not defined error. To resolve this I believe we need a way to load latest jQuery before the load-scripts.php file is rendered and I am not sure if is there any WP hook available to do this.

    Let me know if that makes sense? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Update jQuery Version to 3.x’ is closed to new replies.