is_active_sidebar not working as advertised
|Reported by:||mortenf||Owned by:||azaozz|
Per the inline documentation for "is_active_sidebar", the single ("mixed $index") parameter is a "sidebar name, id or number to check".
However, the function only works correctly in the case of number (an integer). In the case of id (e.g. "foobar-1") it only works correctly, when the id survives a trip through "sanitize_title".
In the case of trying to use a name, the function doesn't work at all, due to the array returned from "wp_get_sidebars_widgets" being keyed on sidebar ids (e.g. "foobar-1").
Either the inline documentation should be changed to reflect reality (use of a sidebar name is not possible), or the function should be fixed, perhaps by using attached patch, that uses a copy of a code fragment from "dynamic_sidebar" (a code fragment that could also exist by itself in a new function "wp_sidebar_index($name)").
Change History (9)
- Keywords has-patch added; has_patch removed
- Milestone changed from Unassigned to 2.9