[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 18:11:32 GMT 2009


#10136: is_active_sidebar() should use wp_get_sidebars_widgets()
--------------------------+-------------------------------------------------
 Reporter:  greenshady    |        Owner:  azaozz  
     Type:  defect (bug)  |       Status:  reopened
 Priority:  normal        |    Milestone:  2.8.1   
Component:  Widgets       |      Version:  2.8     
 Severity:  normal        |   Resolution:          
 Keywords:                |  
--------------------------+-------------------------------------------------
Changes (by greenshady):

  * status:  closed => reopened
  * resolution:  wontfix =>
  * milestone:  => 2.8.1


Comment:

 I was under the impression that `unregister_widget()` literally
 unregisters a widget, making it not available for use.  That's what I've
 been using it for.

 What I'm taking about is having the ability to disable a sidebar when I
 need to or a theme/plugin user's sidebar.

 A function like this should do it:

 {{{
 add_filter( 'sidebars_widgets', 'disable_primary_sidebar' );

 function disable_primary_sidebar( $sidebars_widgets ) {
         if ( is_home() )
                 $sidebars_widgets['primary'] = false;

         return $sidebars_widgets;
 }
 }}}

 That disables the primary sidebar on the home page.  I'm sorry, but I
 don't see how this can be accomplished with `unregister_widget()`.

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


More information about the wp-trac mailing list