Answers for "remove jquery migrate from wp site"

0

remove jquery migrate from wp site

Removing jQuery migrate from WordPress is quite easy. You just need to add the 
following lines of code to your theme’s functions.php file.

//Remove JQuery migrate
 
function 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' ) );
 }
 }
 }
add_action( 'wp_default_scripts', 'remove_jquery_migrate' );
Posted by: Guest on March-27-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language