Make WordPress Core

Opened 5 years ago

Last modified 5 years ago

#55074 new defect (bug)

Deactivating WP_Widget_Recent_Comments kills the whole Widgets area

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

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 5 years ago.

Download all attachments as: .zip

Change History (3)

@madeinua
5 years ago

#1 @rafiahmedd
5 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
5 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.