I don't want to get the default value of attribute via get_block_wrapper_attributes().
But get_block_wrapper_attributes() dont work properly if default value of atribute is set in block.json
on frontend there is missing classes about gradient, and gradient is set in backend
just try to check:
To Reproduce
Steps to reproduce the behavior:
For example I have own block: FAQ, In block.json I will add to set some default background such code: (there is bug also with paddings ...)
"attributes": { "gradient": { "type": "string", "default": "vivid-cyan-blue-to-vivid-purple" }},
In my rendered php I have
<section <?= !$is_preview ? get_block_wrapper_attributes() : ''; ?>>
Then I will add my block in gutenberg editor. (default background was set) and I will save
Check frontend, and class has-vivid-cyan-blue-to-vivid-purple-gradient-background is missing there
I will change to another background or gradient, and on frontend is showing correct
then I will change gradient back to vivid-cyan-blue-to-vivid-purple and class is missing
regarding to this issue https://github.com/AdvancedCustomFields/acf/issues/883
we misunderstood,
I don't want to get the default value of attribute via get_block_wrapper_attributes(). But get_block_wrapper_attributes() dont work properly if default value of atribute is set in block.json
on frontend there is missing classes about gradient, and gradient is set in backend
just try to check:
To Reproduce Steps to reproduce the behavior:
For example I have own block: FAQ, In block.json I will add to set some default background such code: (there is bug also with paddings ...)
"attributes": { "gradient": { "type": "string", "default": "vivid-cyan-blue-to-vivid-purple" }},
In my rendered php I have
<section <?= !$is_preview ? get_block_wrapper_attributes() : ''; ?>>
Then I will add my block in gutenberg editor. (default background was set) and I will save
Check frontend, and class has-vivid-cyan-blue-to-vivid-purple-gradient-background is missing there
I will change to another background or gradient, and on frontend is showing correct
then I will change gradient back to vivid-cyan-blue-to-vivid-purple and class is missing