I am working on a CSS and JS compiler and need to find a way to list the contents of wp_head()
I am trying to get a list of all CSS/JS files and inline CSS on any give page.
Hooking on the wp_head action does not do anything
I was hoping that something like this would work
function head_content($list){
print_r($list);
}
add_action('wp_head', 'head_content');
any help is appreciated.
UPDATE:
got something working
function head_content($list){
print_r($list);
return $list;
}
add_filter('print_styles_array', 'head_content');
add_filter('print_script_array', 'head_content');
this lists all css/js files handles
wp_head
is an action, actions don't have data passed to them. it's just an event that other things are hooked to, likewp_enqueue_scripts
.