[wp-trac] [WordPress Trac] #41743: Using the_widget on a widget that has not been registered results in an undefined index notice.

WordPress Trac noreply at wordpress.org
Thu Aug 31 21:01:30 UTC 2017


#41743: Using the_widget on a widget that has not been registered results in an
undefined index notice.
--------------------------------------+------------------
 Reporter:  SeBsZ                     |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.9
Component:  Widgets                   |     Version:  2.8
 Severity:  normal                    |  Resolution:
 Keywords:  good-first-bug has-patch  |     Focuses:
--------------------------------------+------------------

Comment (by westonruter):

 To me it seems having a notice/warning is better than failing silently. If
 you have a theme/plugin that is calling `the_widget()` then you should
 know when it fails.

 The other option would be to return a `WP_Error` on failure, and `true` on
 success.

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


More information about the wp-trac mailing list