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

WordPress Trac noreply at wordpress.org
Sun Nov 15 12:15:34 UTC 2015


#19709: Add 'before_sidebar' and 'after_sidebar' attributes to register_sidebar()
----------------------------------+------------------------------
 Reporter:  dgwyer                |       Owner:
     Type:  enhancement           |      Status:  reopened
 Priority:  normal                |   Milestone:  Awaiting Review
Component:  Widgets               |     Version:  2.2
 Severity:  normal                |  Resolution:
 Keywords:  has-patch needs-docs  |     Focuses:
----------------------------------+------------------------------
Changes (by flixos90):

 * keywords:  needs-patch => has-patch needs-docs


Comment:

 The patch above adds the two new arguments `before_sidebar` and
 `after_sidebar` into the array. `before_sidebar` can be a string like
 `<div id="%1$s" class="%2$s">` and will receive sidebar ID and class. A
 thing to consider is what happens if the class argument is empty
 (default)? There would be an empty class attribute. I guess in this case
 the only way to work around it would be to remove the class attribute from
 the string if it is there.

 However I would say that is the theme author's business. What I just
 described above would probably be too much here.

 If the new arguments are provided, they are outputted after the
 `dynamic_sidebar_before` action / before the `dynamic_sidebar_after`
 action, respectively.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/19709#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list