Bringing script/style registering out of the stone age
-
Welcome to 2016. Frontend build tools make it super easy to allow us creating script bundles of different libraries. Yet, there’s just no way to effectively handle script bundles with WordPress’s script registering/enqueuing functions.
For future reference, when I say script bundle I’m refering to a single Javacript file that includes multiple libraries like jQuery, Underscore, Backbone and others present on WordPress core.
When creating a WordPress website for a single client (as opposed to a feature rich, non-/commercial template) I’m in control of plugins being used. And I want to be able to handle all their dependencies manually by deregistering scripts they load and provide my own script bundle. This is impossible to do because there’s no way of registering a script with multiple handles.
So please, can we have the $handle param in wp_register_script() be an
array
allowing developers to load a single script bundle of multiple libraries?P.s. Please don’t start an argument about how I’m being stupid for wanting this. My reason is clearly stated above and I want you to accept it as it’s written.
- The topic ‘Bringing script/style registering out of the stone age’ is closed to new replies.