Describe the bug
When an attribute isn't changed, the value will not be written into the serialized html comment, which in fact, makes it unaccessible for PHPs render_callback-function.
To Reproduce
Steps to reproduce the behavior:
- Make a custom block
- Add a sourceless attribute with default value
attributes: {
myNumber: {
type: "number",
default: 1, // this number won't appear in the html comments
}
}
- Do not alter the attribute
- Save the content
var_dump() the $attribues in 'render_callback
5b. or look into database, the html comment doesn't contain 'number'
- Be sad 'number' isn't there :'(
Expected behavior
To avoid syncing the defaults in both php and js, I expect gutenberg to save defaults into the html comment aswell.
Desktop (please complete the following information):
- OS: MacOS High Sierra
- Browser Doesn't matter
- Version Doesn't matter
Additional context
Describe the bug
When an attribute isn't changed, the value will not be written into the serialized html comment, which in fact, makes it unaccessible for PHPs
render_callback-function.To Reproduce
Steps to reproduce the behavior:
var_dump()the$attribuesin'render_callback5b. or look into database, the html comment doesn't contain 'number'
Expected behavior
To avoid syncing the defaults in both php and js, I expect gutenberg to save defaults into the html comment aswell.
Desktop (please complete the following information):
Additional context