Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#55074 new defect (bug)

Deactivating WP_Widget_Recent_Comments kills the whole Widgets area

Reported by: madeinua's profile madeinua Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.9
Component: Widgets Keywords:
Focuses: Cc:

Description

This expression makes the Widgets page empty:

unregister_widget( 'WP_Widget_Recent_Comments' );

Were no problems with WordPress 5.8.

Attachments (1)

widgets.png (5.2 KB) - added by madeinua 3 years ago.

Download all attachments as: .zip

Change History (3)

@madeinua
3 years ago

#1 @rafiahmedd
3 years ago

I was trying to recreate the issue in the latest 5.9 however I am unable to do this. Could you please add some more details on this?

#2 @madeinua
3 years ago

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

Note: See TracTickets for help on using tickets.