Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#14548 closed defect (bug) (duplicate)

registered sidebars with capital letter in the ID don't get loaded

Reported by: wjm Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Widgets Keywords:
Focuses: Cc:


if you use register_sidebar() and set ID to have a capital letter, it will be displayed in the widgets section but its widgets won't get loaded.

'name' => 'RightSideBar',
'id' => 'Rsidebar',

it won't work but


'name' => 'RightSideBar',
'id' => 'rsidebar',

... will work.

This has to do with dynamic_sidebar() using sanitize_title() to sanitize the id, the thing is that sanitize_title() (which calls sanitize_title_with_dashes()) will turn every upper case to a lower case, and later it will look in $wp_registered_sidebars for the key which is non-existant.

This patch sanitizes the sidebar ID at the time of registering it, so using 'id' => 'Rsidebar', or 'id' => 'rsidebar',

registers the same sidebar.

Attachments (1)

register_sidebar_sanitize_id.patch (342 bytes) - added by wjm 8 years ago.

Download all attachments as: .zip

Change History (3)

#2 @nacin
7 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #11160.

Note: See TracTickets for help on using tickets.