<?php
/**
* Change Wordpress jQuery and jQuery Migrate Version
*/
add_action( 'init', static function () {
// jQuery
$core = wp_scripts()->registered['jquery-core'];
$core->ver = '1.12.4';
$core->src = "https://cdnjs.cloudflare.com/ajax/libs/jquery/{$core->ver}/jquery.min.js";
// jQuery Migrate
$migrate = wp_scripts()->registered['jquery-migrate'];
$migrate->ver = '1.4.1';
$migrate->src = "https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/{$migrate->ver}/jquery-migrate.min.js";
// Register
$jquery = wp_scripts()->registered['jquery'];
$jquery->ver = $core->ver;
$jquery->deps = [ 'jquery-core', 'jquery-migrate' ];
}, 11 );
Last active
July 24, 2025 15:04
-
-
Save MahdiAkrami01/3ec3ce149504630c8e83cbb63939ce9d to your computer and use it in GitHub Desktop.
How to change WordPress jQuery and jQuery Migrate version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment