[wp-trac] [WordPress Trac] #55074: Deactivating WP_Widget_Recent_Comments kills the whole Widgets area

WordPress Trac noreply at wordpress.org
Fri Feb 4 13:16:34 UTC 2022


#55074: Deactivating WP_Widget_Recent_Comments kills the whole Widgets area
--------------------------+------------------------------
 Reporter:  madeinua      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Widgets       |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by madeinua):

 This may be the problem with my customized theme. But what I found is that
 this part:

 functions.php

 {{{
 remove_action('init', 'wp_widgets_init', 1);
 add_action('init', static function () {
         register_widget( 'WP_Nav_Menu_Widget' );
         do_action( 'widgets_init' );
 }, 1);
 }}}

 Throws this error:

 Warning:  foreach() argument must be of type array|object, null given in
 \wp-includes\widgets.php on line 1552

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


More information about the wp-trac mailing list