Skip to content

Instantly share code, notes, and snippets.

@gMagicScott
Created April 21, 2014 03:52
Show Gist options
  • Save gMagicScott/11131763 to your computer and use it in GitHub Desktop.
Save gMagicScott/11131763 to your computer and use it in GitHub Desktop.
Disable jQuery Migrate

I drop this in WPMU_PLUGIN_DIR when developing.

WPMU_PLUGIN_DIR defaults to wp-content/mu-plugins/ but is configurable in wp-config.php

<?php
add_filter( 'wp_default_scripts', function ( &$scripts ) {
if( ! is_admin() ) {
$jquery_version = $scripts->registered[ 'jquery' ]->ver;
$scripts->remove( 'jquery');
$scripts->add( 'jquery', false, array( 'jquery-core' ), $jquery_version );
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment