Opened 16 years ago
Closed 15 years ago
#14548 closed defect (bug) (duplicate)
registered sidebars with capital letter in the ID don't get loaded
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.0 |
| Component: | Widgets | Keywords: | |
| Focuses: | Cc: |
Description
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.
register_sidebar(array( 'name' => 'RightSideBar', 'id' => 'Rsidebar', ));
it won't work but
while...
register_sidebar(array( '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)
Change History (3)
Note: See
TracTickets for help on using
tickets.
this issue was found here,
http://www.wpquestions.com/question/show/id/713