Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
Created June 8, 2020 06:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lynt-smitka/86938a8f893c80227d2f1f1a2c48fa03 to your computer and use it in GitHub Desktop.
Save lynt-smitka/86938a8f893c80227d2f1f1a2c48fa03 to your computer and use it in GitHub Desktop.
add_action('wp_default_scripts', 'lynt_remove_jquery_migrate');
function lynt_remove_jquery_migrate($scripts)
{
if (!is_admin() && isset($scripts->registered['jquery'])) {
$script = $scripts->registered['jquery'];
if ($script->deps) { // Check whether the script has any dependencies
$script->deps = array_diff($script->deps, array(
'jquery-migrate'
));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment