Solution:
The solution is load WordPress default jQuery libraries when you are logged in as admin. Otherwise for web users jQuery CDN links work fine.
In script-loader.php
if (is_admin()) { //back-end $scripts->add( 'jquery-core', "/wp-includes/js/jquery/jquery$suffix.js", array(), '3.6.1' ); $scripts->add( 'jquery-migrate', "/wp-includes/js/jquery/jquery-migrate$suffix.js", array(), '3.3.2' ); $scripts->add( 'jquery-ui-core', "/wp-includes/js/jquery/ui/core$suffix.js", array( 'jquery' ), '1.13.2', 1 ); } else { //front-end $scripts->add( 'jquery-core', "https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js", array(), '3.6.1' ); $scripts->add( 'jquery-migrate', "https://cdnjs.cloudflare.com/ajax/libs/jquery-migrate/3.3.2/jquery-migrate.min.js", array(), '3.3.2' ); $scripts->add( 'jquery-ui-core', "https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.13.2/jquery-ui.min.js", array( 'jquery' ), '1.13.2', 1 ); }
No comments:
Post a Comment