Blocks in Customizer: Use temporary fix to make blocks appear #29283
Labels
[Feature] Widgets Customizer
Ability to add and edit blocks in Customize → Widgets.
[Status] In Progress
Tracking issues with work in progress
[Type] Task
Issues or PRs that have been broken down into an individual action to take
In #28618 the ability to see blocks in Customize -> Widgets was added.
Right now only a JSON representation of the block appears because we can't handle blocks serialization correctly yet. We are using the customizer API to get the contents of the widget, which looks something like:
Notice that the content of the widget is a base64-encoded serialized string, which can be unserialize via
sanitize_widget_instance
. However, there's no equivalent of that in JS. We need to think of another way to do this. Hence, as a fallback, we're just serializing it to string for now.As a temporary fix that lets us continue work on the Customizer user interface, let's make it so that the Customizer sends the frontend and accepts a non-serialized
instance
array instead ofencoded_serialized_instance
.This would be superseded by a proper fix which accounts for attributes that cannot be JSON serialized, see #28902.
The text was updated successfully, but these errors were encountered: