Created
June 9, 2021 17:13
-
-
Save sabrina-zeidan/229a2fa7632d062c1ecaea0e4028a633 to your computer and use it in GitHub Desktop.
This a draft, untested
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Alter_WP_Scripts extends WP_Scripts{ | |
//also $deps method! | |
function do_item( $handle, $group = false ){ | |
if( 'handle_here' == $handle ){ | |
$handle = false; | |
} | |
return parent::do_item( $handle, $group ); | |
} | |
} | |
if( !is_admin() ){ | |
add_action( 'wp_loaded', function() { | |
$GLOBALS['wp_scripts'] = new Alter_WP_Scripts; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment