Filter enqueued styles and scripts
I am looking for a way to reorganize the scripts/styles queue in WP.
I am well aware of the fact altering the queue may have undesired effects, but in this case there are solid reasons for doing it and I will be keeping the situation under control.
I did not find a native WP filter to get that done.
How may I achieve that? I thought about creating a function that prints the styles but caches the content via PHP Output Buffer and then parsing it with PHP Dom Document.
But… there has to be a less hacky way. Any suggestions?