Skip to content

Instantly share code, notes, and snippets.

@guydumais
Last active March 23, 2021 01:04
Show Gist options
  • Save guydumais/8c2a27c586d3c96121cf23d413c5ab5c to your computer and use it in GitHub Desktop.
Save guydumais/8c2a27c586d3c96121cf23d413c5ab5c to your computer and use it in GitHub Desktop.
WordPress ➧ Désactiver jQuery Migrate dans WordPress
<?php
/**
* Désactiver jQuery Migrate dans WordPress.
*
* @author Guy Dumais.
* @link https://guydumais.digital//fr/blog/desactiver-jquery-migrate-dans-wordpress/
*/
add_filter( 'wp_default_scripts', $af = static function( &$scripts) {
if(!is_admin()) {
$scripts->remove( 'jquery');
$scripts->add( 'jquery', false, array( 'jquery-core' ), '1.12.4' );
}
}, PHP_INT_MAX );
unset( $af );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment