#2752 closed enhancement (fixed)
Add id and description to default widget block
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | ||
Component: | Templates | Keywords: | |
Cc: | wp@… |
Description
Just like the new footer widgets I suggest the default ones have id and description added to them.
Currently they read like this:
register_sidebar( array( 'name' => 'Sidebar', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>' ) );
My suggestions would be to end up with something like this:
register_sidebar( array( 'name' => 'Sidebar', 'id' => 'sidebar', 'description' => __( 'The sidebar widget area', 'buddypress' ), 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widgettitle">', 'after_title' => '</h3>' ) );
Change History (9)
#1
@
14 years ago
- Summary changed from Add id and desription to default widget block to Add id and description to default widget block
#4
@
14 years ago
- Cc wp@… added
Not having an ID can be dangerous, and is basically deprecated in core. Core then numbers them based on order registered, and if a child theme registers more, all hell can go loose.
#7
@
14 years ago
It seems if I add an ID to the old sidebar, WP thinks it is a different sidebar block (due to the different id) and therefore doesn't load the old widgets into it. I don't want to "break" people sidebars when they upgrade to 1.3. Anyone familiar with this behaviour or a workaround?
I'm about to commit this, but I have left out the ID as that breaks the style, plus we already have a div id="sidebar" in the theme.