Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello ??

    You don’t need a plugin to do that. Simply update the instructions in your function.php theme, like I explained it here : https://live.otakugame.fr/optimiser-wordpress-en-utilisant-jsdeliver-google-library-pour-jquery/

    It’s much better, you can also choose your favorite CDN ?? !

    Please check his website out if you speak a little bit french. His solution is the only one that really works as far as I have been able to research.

    function register_jquery() {
    	if (!is_admin()) {
    		wp_deregister_script('jquery-core');
    		wp_register_script('jquery-core', 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js', TRUE, '2.2.2');
    		wp_enqueue_script('jquery-core');
    		wp_deregister_script('jquery-migrate');
    		wp_register_script('jquery-migrate', 'https://cdn.jsdelivr.net/jquery.migrate/1.2.1/jquery-migrate.min.js', TRUE, '1.2.1');
    		wp_enqueue_script('jquery-migrate');
    		wp_deregister_script('jquery-ui');
    		wp_register_script('jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js', TRUE, '1.11.4');
    		wp_enqueue_script('jquery-ui');
    	}
    }
    
    add_action('wp_enqueue_scripts', 'register_jquery');

    Attention: jQuery 2 dropped support for IE below 9. So you have to have some functionality to dynamically go back to the older jQuery, e.g. like that (this is code from my redis caching engine):

    if (preg_match('/(?i)msie [5-8]/', $_SERVER['HTTP_USER_AGENT'])) {
    		// if IE<=8
    		$content = str_replace('https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js',
    							   'https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js', $content);
    	}
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Upgraded WP to 4.2.2 and WP reverted to using standard jquery’ is closed to new replies.