[wp-trac] [WordPress Trac] #10440: is_active_sidebar not working as advertised

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 18 14:14:51 UTC 2009


#10440: is_active_sidebar not working as advertised
--------------------------+-------------------------------------------------
 Reporter:  mortenf       |       Owner:  azaozz    
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Widgets       |     Version:  2.8.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 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)").

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10440>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list