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

WordPress Trac noreply at wordpress.org
Fri Apr 18 13:54:31 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 needle):

 Replying to [comment:11 nacin]:
 > We can't get a null value from the database, so if the option is
 returning that, then it sounds like there is a callback on a filter
 somewhere. Possibly even more likely is that callback is not returning
 anything (improperly), thus the implicit null.

 Ah yes, good point... since `option_value` is longtext, the return from
 `get_option('sidebars_widgets', array())` is actually an empty string
 rather than null.

 I'm fairly certain that the initial error is not of WP's making. I'm
 trying to find out how the option came to be cleared. Nevertheless, WP
 does not sanity check `$sidebars_widgets` before returning it to
 `array_merge` in `customize_register()`.

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


More information about the wp-trac mailing list