Created
February 25, 2018 20:44
-
-
Save carlitoescobar/7a0c1fcd136c70f2658eccbff81b3671 to your computer and use it in GitHub Desktop.
Query Migrate is a script meant to create a downward compatibility of older jQuery applications. The “normal” and modern jQuery version does not support all old applications anymore. While this won’t affect more than 5% of all WordPress website, WordPress loads the pretty sizeable script by default. Here’s an easy way to turn it off:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Dequeue jQuery Migrate Script in WordPress. | |
*/ | |
if ( ! function_exists( 'evolution_remove_jquery_migrate' ) ) : | |
function evolution_remove_jquery_migrate( &$scripts) { | |
if(!is_admin()) { | |
$scripts->remove( 'jquery'); | |
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' ); | |
} | |
} | |
add_filter( 'wp_default_scripts', 'evolution_remove_jquery_migrate' ); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment