[wp-trac] [WordPress Trac] #19709: Add 'before_sidebar' and 'after_sidebar' attributes to register_sidebar()

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 1 19:30:16 UTC 2012


#19709: Add 'before_sidebar' and 'after_sidebar' attributes to register_sidebar()
-------------------------+-----------------------------
 Reporter:  dgwyer       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Widgets      |    Version:  3.3
 Severity:  normal       |   Keywords:
-------------------------+-----------------------------
 Whilst experimenting with some code recently I needed to have each widget
 area wrapped inside a container with the widget id as the container CSS
 class/id.

 If used in a theme this widget area container usually has to be hard
 coded. This is the case for Twenty Ten, and Twenty Eleven.

 It occurred to me that it would be very useful to have an extra couple of
 attributes available in register_sidebar() such as 'before_sidebar' and
 'after_sidebar' so that developers have a consistent way to automatically
 add a wrapper to each widget area.

 It would be additionally useful if you could do something like this to add
 the widget area id as the wrapper CSS class/id as required:

 `'before_sidebar' => '<div class="%3$s">'`
 `'after_sidebar' => '</div>'`

 or

 `'before_sidebar' => '<div id="%3$s">'`
 `'after_sidebar' => '</div>'`

 If this feature is considered then I'm not sure whether 'before_sidebar'
 or 'before_widget_area' is a better choice for the attribute name.

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


More information about the wp-trac mailing list