I'm looking for a way to prevent all css and js files from being loaded (default theme and plugins). Is there any way to do that? at least reach to minumim file load... .
1 Answer
I'm not really sure why you'd want to do this...but the only thing I can think of that might work is something like this:
function prefix_block_resources(){
if(is_admin())return; //I can't imagine any scenario where blocking scripts in the admin area would be wise.
global $wp_scripts;
global $wp_styles;
$wp_scripts->queue = array();
$wp_styles->queue = array();
return;
}
add_action('wp_head', 'prefix_block_resources');
That will block any styles and scripts that have been loaded using the WordPress API, it won't do anything about styles/scripts that have been hardcoded into the theme.