Where can I get the list of styles about to be printed? What i want is to either filter the list, doing what i want with each, then return empty list. Or do an action that recieves the list, then i can remove_action the print_styles. Something like that, anyway. I’m creating a css minifier concatenizer.
Leave a Reply
You must be logged in to post a comment.
There is a global variable named
$wp_styles
. It is aWP_Styles
object (if it exists at all) and it holds all the enqueued styles in a public variable$queue
.Untested:
Make sure you test that after the
init
hook, because stylesheets should not be enqueued earlier.For details see:
/wp-includes/functions.wp-styles.php
,/wp-includes/class.wp-styles.php
and/wp-includes/class.wp-dependencies.php