[wp-trac] [WordPress Trac] #35928: Notice in `is_dynamic_sidebar()`

WordPress Trac noreply at wordpress.org
Tue Feb 23 22:13:43 UTC 2016


#35928: Notice in `is_dynamic_sidebar()`
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Widgets       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 A sidebar can be registered but not yet have an index in the
 `sidebars_widgets` option.

 `is_dynamic_sidebar()` checks `count($sidebars_widgets[$index])` for each
 registered sidebar, potentially, but if it reaches a sidebar that doesn't
 have an index in the option, it generates an "undefined index" notice.

 The attached patch adds an `isset()` check.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35928>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list