[wp-trac] [WordPress Trac] #10136: is_active_sidebar() should use
wp_get_sidebars_widgets()
WordPress Trac
wp-trac at lists.automattic.com
Sat Jun 13 04:07:11 GMT 2009
#10136: is_active_sidebar() should use wp_get_sidebars_widgets()
--------------------------+-------------------------------------------------
Reporter: greenshady | Owner: azaozz
Type: defect (bug) | Status: new
Priority: normal | Milestone: 2.8.1
Component: Widgets | Version: 2.8
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
Some themes and plugins use the `sidebars_widgets` filter hook to disable
a particular sidebar (see: [http://justintadlock.com/archives/2009/03/06
/disable-widget-areas-without-touching-theme-templates]).
This gives themes/plugins more flexibility, which is what I'm sure we were
aiming for with the `is_active_sidebar()` function. But, since
`is_active_sidebar()` uses `get_option()` to check for sidebars, the
`sidebars_widgets` filter hook is bypassed.
What I propose is a one-line change of:
{{{
$sidebars_widgets = get_option( 'sidebars_widgets', array() );
}}}
To:
{{{
$sidebars_widgets = wp_get_sidebars_widgets();
}}}
I haven't had any issues with this change. And, I can think of no other
ways to disable a sidebar.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/10136>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list