Skip to content

Instantly share code, notes, and snippets.

@andreilupu
Created May 7, 2017 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreilupu/2f16d752b06e7ddb8ba94e40f8b592a6 to your computer and use it in GitHub Desktop.
Save andreilupu/2f16d752b06e7ddb8ba94e40f8b592a6 to your computer and use it in GitHub Desktop.
Add this file in the `/wp-content/mu-plugins/` directory in it will automatically be loaded by WordPress
<?php
function disable_jquerymigrate_warning( $scripts ) {
if ( ! empty( $scripts->registered['jquery'] ) ) {
$scripts->registered['jquery']->deps = array_diff( $scripts->registered['jquery']->deps, array( 'jquery-migrate' ) );
}
}
add_action( 'wp_default_scripts', 'disable_jquerymigrate_warning' );
@andreilupu
Copy link
Author

Actually removing jquery.migrate is a bad practice and may trigger some javascript errros.
Consider an error mute

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment