Opting out of the widgets-block-editor theme support crashes the editor serverside #30305
Labels
[Feature] Widgets Screen
The block-based screen that replaced widgets.php.
[Package] Edit Widgets
/packages/edit-widgets
[Status] In Progress
Tracking issues with work in progress
[Type] Bug
An existing feature does not function as intended
Since merging #29649 we introduced a
show_instance_in_rest
property to widgets to determine their visibility for the Legacy Widget Block and other consumers.Because core widgets don't yet have this property we have a function
gutenberg_set_show_instance_in_rest_on_core_widgets
which as the name says adds this property and sets it to true.However part of the core widgets we also consider
WP_Widget_Block
which does not get registered ifwidgets-block-editor
theme support is removed. This results in a fatal error:A solution (via @fullofcaffeine) is to check if the widget is registered before we try to set its properties. Since
unregister_widget
exists we should check this anyway until that function is merged and we don't need to loop through all core widgets anymore.The text was updated successfully, but these errors were encountered: