[wp-trac] [WordPress Trac] #14876: wp_get_sidebars_widgets() assumes that widgets are enabled

WordPress Trac noreply at wordpress.org
Fri Apr 18 06:40:21 UTC 2014


#14876: wp_get_sidebars_widgets() assumes that widgets are enabled
--------------------------+-----------------------------
 Reporter:  nacin         |       Owner:
     Type:  defect (bug)  |      Status:  reopened
 Priority:  lowest        |   Milestone:  Future Release
Component:  Widgets       |     Version:
 Severity:  minor         |  Resolution:
 Keywords:                |     Focuses:
--------------------------+-----------------------------

Comment (by westonruter):

 Replying to [comment:8 needle]:
 > I have encountered a fatal error in
 `WP_Customize_Widgets->customize_register()` when opening the Theme
 Customizer. This was after switching to a theme that has only one (empty)
 widget area. I confirmed that `$sidebars_widgets` in
 `wp_get_sidebars_widgets()` is not set, which throws the error when
 customize_register() tries to include the result in an `array_merge()`.

 Strange, because `wp_get_sidebars_widgets()` is supplying `array()` as the
 default fallback value if the `sidebars_widgets` option has not been
 added:

 {{{
 $sidebars_widgets = get_option('sidebars_widgets', array());
 }}}

 So it shouldn't be returning anything other than an array. What does
 `$sidebars_widgets` get set to in your environment?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/14876#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list