Skip to content

Instantly share code, notes, and snippets.

@sabrina-zeidan
Created June 9, 2021 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sabrina-zeidan/229a2fa7632d062c1ecaea0e4028a633 to your computer and use it in GitHub Desktop.
Save sabrina-zeidan/229a2fa7632d062c1ecaea0e4028a633 to your computer and use it in GitHub Desktop.
This a draft, untested
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