@kobenland I like the goal of this idea. I also feel that the script/style system is more complex that it needs to be and it needs to be simplified. I think it would be better to implement a more general data method that could be used for many purposes rather than adding a function that only gets used a few times. A function like the example below would be capable of storing data related to scripts/styles and practically anything else. Also (loosely related) see #22249

@kobenland I like the goal of this idea. I also feel that the script/style system is more complex that it needs to be and it needs to be simplified. I think it would be better to implement a more general data method that could be used for many purposes rather than adding a function that only gets used a few times.

I appreciate your feedback! I merely proposed an abstraction of existing functionality though. Maybe it would be a good idea to open a new ticket with what you came up with?

18753.2.diff​ is good to go. Per IRC, leaving Twenty Twelve out of this. It's just more code, not really needed. If it were legitimately easier, I'd argue sure. but it's a function wrapping a method, not even a function rename or something.

Pointing out that it avoids the did_action() and new WP_Styles stuff because this is a new function. The original functions simply set up WP_Styles on demand, at any time — we needed to dress it up when we wanted to add_doing_it_wrong() and such. But if this new function gets called too early, it'll simply trigger a fatal error.