Documentation: Reference: Attributes code samples should show save callbacks #4071
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
[Type] Developer Documentation
Documentation for developers
Milestone
The reference page for attributes shows how to register attributes so they are de-serialized from the saved HTML. The examples do not show the corresponding save() callbacks making it harder to understand the concept.
https://wordpress.org/gutenberg/handbook/reference/attributes/
For instance the first example
Example: Extract the src attribute from an image found in the block’s markup.
shows how to extract from a saved image, but doesn't show how to save an image. That's actually how it's done here: https://wordpress.org/gutenberg/handbook/blocks/introducing-attributes-and-editable-fields/ and that is much better at illustrating the relationship between saving and using attributes.The text was updated successfully, but these errors were encountered: