[wp-trac] [WordPress Trac] #31675: register_sidebar() without `id` parameter should be _doing_it_wrong()
WordPress Trac
noreply at wordpress.org
Wed Mar 18 01:44:29 UTC 2015
#31675: register_sidebar() without `id` parameter should be _doing_it_wrong()
-------------------------+-----------------------------
Reporter: markjaquith | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Widgets | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
If you register a widget area with `register_sidebar()` and neglect to
provide an `id` parameter, WordPress generates auto-increment ones for
you. The `id` is how WordPress stores the widget area's contents.
Consider this:
{{{
register_sidebar( array( 'One' ) );
register_sidebar( array( 'Two' ) );
register_sidebar( array( 'Three' ) );
}}}
If you comment out 'One' or 'Two', the contents of the remaining ones will
get scrambled!
Best practice is to provide an 'id'. We should encourage that.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31675>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list