-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: More examples of save() callback of block #4070
Comments
From #4071.
|
I think something to note here is that some of this is handled automatically and should just be noted, e.g. "Serializing attributes to main comment" — this should be an automatic thing, I believe. In terms of this, I'm not sure this is really recommended at this point…
So maybe that's more of a philosophical "here's why they're separate things" question? |
Another thing that should be documented is that if an attribute has the default when the post is saved, that attribute does not get serialized in the comment. I actually think that behavior is a "bug" (for some definition of "bug"). Consider the following:
So, at the vary least, the fact that default attributes values are not serialized should be documented, including the consequences of that fact (like the example above). |
Related: #7342 |
@ajitbohra This might be another good one for you to review! |
Not that I remember of. The ones I wrote tend to be more focused on a developer-facing task and don't go deeper on the APIs involved - just use the parts needed, as to familiarize people with them. Perhaps serialization docs in the handbook need to be expanded? |
After spending some time teaching myself Gutenberg, I found the information on the save() callback for blocks and how serializing data to comments works
https://wordpress.org/gutenberg/handbook/block-edit-save/
In regards to serialization of data, it would be helpful if it was explained how automatic serialization of attributes work. A link to the section on attributes is also needed.
The text was updated successfully, but these errors were encountered: