Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default values for
align_text
andalign_content
don't work currently.I figured out that
alignText
andalignContent
attributes are automatically added to the block definition when enabling support for these properties. The values of both properties don't reflect the default values that are set in the Block definition.Let's say we have a simple Block that have centered text and content as default values.
When adding a new block to the editor the defaults are not used.
If I dump the
$block
variable that is passed to therender
function ofsrc/Block.php
I can see thatalignText
andalignContent
are automatically set toleft
andtop
I think this bug has been introduced since ACF 6. According to this thread they have added the camel-case properties to match the block.json format.
There is a comment referencing the same issue but no solution have been provided.
I found out that adding the
alignText
andalignContent
properties to the block settings fixes the issue.