[wp-trac] [WordPress Trac] #20513: Refactor $wp_scripts init checking code

WordPress Trac wp-trac at lists.automattic.com
Sun Apr 22 15:15:36 UTC 2012


#20513: Refactor $wp_scripts init checking code
-------------------------+-------------------------------------
 Reporter:  GaryJ        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  3.4
 Severity:  normal       |   Keywords:  has-patch needs-testing
-------------------------+-------------------------------------
 The functions in [http://core.trac.wordpress.org/browser/trunk/wp-
 includes/functions.wp-scripts.php 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).

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/20513>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list