-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Legacy Widget add support for widgets with attributes that can't be serialised into JSON #28902
Copy link
Copy link
Closed
Labels
REST API InteractionRelated to REST APIRelated to REST API[Block] Legacy WidgetAffects the Legacy Widget Block - used for displaying Classic WidgetsAffects the Legacy Widget Block - used for displaying Classic Widgets[Feature] Widgets CustomizerAbility to add and edit blocks in Customize → Widgets.Ability to add and edit blocks in Customize → Widgets.[Feature] Widgets ScreenThe block-based screen that replaced widgets.php.The block-based screen that replaced widgets.php.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Metadata
Metadata
Assignees
Labels
REST API InteractionRelated to REST APIRelated to REST API[Block] Legacy WidgetAffects the Legacy Widget Block - used for displaying Classic WidgetsAffects the Legacy Widget Block - used for displaying Classic Widgets[Feature] Widgets CustomizerAbility to add and edit blocks in Customize → Widgets.Ability to add and edit blocks in Customize → Widgets.[Feature] Widgets ScreenThe block-based screen that replaced widgets.php.The block-based screen that replaced widgets.php.[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
Description
The Legacy Widget block will choke when used with a widget that has an instance attribute which can't be serialised into JSON. WordPress supports storing any PHP value in a widget's instance attributes.
Step-by-step reproduction instructions
gutenberg.php:Navigate to Appearance → Widgets.
Use the insert to add a Date legacy widget.
Set a date and press Update.
Refresh the page.
Expected behaviour
The Date legacy widget should be in the editor and display the date that was set.
Actual behaviour
The Date legacy widget is missing from the editor and there are network errors in DevTools.
Screenshots or screen recording (optional)
WordPress information
trunkmaster