acf-composer
acf-composer copied to clipboard
π Issue: `align: ""` is stripped, causing fallback to default align setting on load
Explicitly setting align: "" β such as when a user sets alignment to βnoneβ β does not persist. Itβs stripped during editor load, before saving, causing the block to fall back to its default alignment value (e.g. "full").
Steps to reproduce:
- Define an ACF block via acf-composer with:
public $align = 'full';
public $supports = [
'align' => true,
// ...
];
-
Insert the block β it appears with
align="full"β -
Reset alignment to none in the editor β sets
align: ""β -
Reload the editor
-
Notice in editor markup that align is already removed β it was stripped on load
-
The block then renders with default align setting again, e.g. "full" β
Expected behavior:
ACF-composer should preserve explicit empty alignment attributes. If a user chooses no alignment, align: "" should persist through serialization and rendering, matching native blocks like core/cover.
What next: This needs further testing & debugging (cached/uncached). A good starting point is here: https://github.com/Log1x/acf-composer/blob/master/src/Block.php#L391-L514