Widgets screen: PHP notices with the legacy Recent Posts widget and possibly other legacy widgets #25910
Labels
[Block] Legacy Widget
Affects the Legacy Widget Block - used for displaying Classic Widgets
[Feature] Widgets Screen
The block-based screen that replaced widgets.php.
[Priority] High
Used to indicate top priority items that need quick attention
[Type] Bug
An existing feature does not function as intended
Describe the bug
While testing the new Widgets screen, I noticed a blank space at the top of the admin menu:
this space is added by the core
php-error
CSS class set on the body when some PHP notice/warning/error is detected. Its purpose is to make the notice/warning/error text fully visible. However, there was no output so this was a bit difficult to debug.Turns out it happens when a Recent Posts widget is already in use.
To reproduce
define( 'WP_DEBUG', true );
is set in yourwp-config.php
filebefore_widget
,before_title
,after_title
,after_widget
Screenshot:
I tested only with the Recent Posts widget but likely these notices are triggered also with other legacy widgets.
Expected behavior
To not have PHP notices.
Editor version (please complete the following information):
The text was updated successfully, but these errors were encountered: