[wp-trac] Re: [WordPress Trac] #6071: register_sidebars should allow name to be an array

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 17 22:29:57 GMT 2008


#6071: register_sidebars should allow name to be an array
-------------------------------------+--------------------------------------
 Reporter:  AaronCampbell            |        Owner:  mdawaffe
     Type:  defect                   |       Status:  new     
 Priority:  normal                   |    Milestone:  2.5.1   
Component:  General                  |      Version:          
 Severity:  normal                   |   Resolution:          
 Keywords:  has-patch needs-testing  |  
-------------------------------------+--------------------------------------
Comment (by AaronCampbell):

 Honestly, I've never used the ID option there, so I guess I overlooked it.
 I suppose we could either accept another array that we assume is in the
 same order as the name, or we could accept an array of arrays, each one
 containing name, id, etc.

 It seems like it might be even easier to push more of the processing to
 register_sidebar().  For example, if there is only one sidebar, why aren't
 we passing it straight to sidebar?  If there is more than one to add, it
 seems like we should check if $args is an array of string or an array of
 arrays.  If it's an array of strings, we should call
 register_sidebar($args) $number times.  If it's an array of arrays, then
 we should loop through $args, calling register_sidebar() for each, either
 using the [0] index for any extras (for example, $args contains 4 arrays,
 but 5 sidebars were requested to be added), or passing nothing to
 register_sidebar(), letting it use the defaults.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/6071#comment:6>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list