[wp-trac] Re: [WordPress Trac] #10136: is_active_sidebar() should use wp_get_sidebars_widgets()

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 13 21:57:11 GMT 2009


#10136: is_active_sidebar() should use wp_get_sidebars_widgets()
-------------------------------+--------------------------------------------
 Reporter:  greenshady         |        Owner:  azaozz  
     Type:  enhancement        |       Status:  reopened
 Priority:  normal             |    Milestone:  2.9     
Component:  Widgets            |      Version:  2.8     
 Severity:  normal             |   Resolution:          
 Keywords:  needs-patch close  |  
-------------------------------+--------------------------------------------

Comment(by greenshady):

 Maybe I haven't completely explained this well enough.  I don't consider
 this an enhancement.  I consider it a bug with the current implementation.

 If someone sets a sidebar to `FALSE` through the `sidebars_widgets` filter
 hook, then `is_active_sidebar()` should return `FALSE` for that particular
 sidebar, but it does not.  It returns `TRUE`.

 To me, this is a bug.  If no one else considers this a bug, then I don't
 see a reason for having the `is_active_sidebar()` conditional tag at all.

 The focus of this ticket has been too much on using
 `wp_get_sidebars_widgets()` rather than finding a solution.  If that
 function is too slow, then a new filter hook needs to be added within
 `is_active_sidebar()` or a new function created.

  * `unregister_sidebar()` won't work because `is_active_widget()` will
 still return `TRUE`.
  * `unregister_sidebar_widget()` won't work because we're talking about
 the entire sidebar and not any widget in particular.
  * All of the plugins I've encountered won't work because they only
 conditionally show/hide a widget and `is_active_sidebar()` still returns
 `TRUE` even when no widgets are being shown.  In fact, they might work
 better if `is_active_sidebar()` could be filtered somehow.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10136#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list