Refactor $wp_scripts init checking code
|Reported by:||GaryJ||Owned by:||wonderboymusic|
|Component:||Script Loader||Keywords:||has-patch needs-testing|
The functions in functions.wp-scripts.php seem to contain a lot of duplicate code in terms of checking and initializing the global $wp_scripts in each function.
Attached is rough first pass at creating a function to do this. I expect aspects of it could be done better.
I've included the first argument, to avoid relying on a global so that the function might be unit tested (pass something in, see what gets returned).
Change History (24)
- Milestone changed from Awaiting Review to Future Release
comment:16 @wonderboymusic — 6 weeks ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from new to closed
comment:17 @wonderboymusic — 6 weeks ago
- Resolution fixed deleted
- Status changed from closed to reopened