is_active_sidebar() should use wp_get_sidebars_widgets()
|Reported by:||greenshady||Owned by:||azaozz|
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() );
$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.
Change History (15)
- Milestone 2.8.1 deleted
- Resolution set to wontfix
- Status changed from new to closed
6 years ago
- Milestone set to 2.8.1
- Resolution wontfix deleted
- Status changed from closed to reopened
- Keywords needs-patch close added
- Type changed from defect (bug) to enhancement