Description
This feature is not backward compatible and creates a space in the anchor, which is not valid html.
if an anchor is set in the block editor, say "my-anchor".
if supports.anchor is set and an attribute "anchor" of type string is set in attributes in block.json
the resulting $block_wrapper_attributtes has an id of "my-anchor my-anchor"
Going back to 22.2.0 fixes the issue, but this means we cannot run the plugin for our own dynamic blocks. If there is a better way, please advise
Step-by-step reproduction instructions
- in block.json set supports.anchor=true
- in block.json set a string type attribute to hold the anchor
- in render.php set the id of get_block_wrapper_attributes()
Screenshots, screen recording, code snippet
$block_wrapper_attributtes = get_block_wrapper_attributes(['id'=>$attributes['anchor']]);
results in
class="..." id="my-anchor my-anchor"
Environment info
WordPress 6.9.1, Gutenberg 22.5.0, 2025 theme
Most current Chrome
16-inch, 2021 M1 MBP running Tahoe 26.2
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
This feature is not backward compatible and creates a space in the anchor, which is not valid html.
if an anchor is set in the block editor, say "my-anchor".
if supports.anchor is set and an attribute "anchor" of type string is set in attributes in block.json
the resulting $block_wrapper_attributtes has an id of "my-anchor my-anchor"
Going back to 22.2.0 fixes the issue, but this means we cannot run the plugin for our own dynamic blocks. If there is a better way, please advise
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
results in
Environment info
WordPress 6.9.1, Gutenberg 22.5.0, 2025 theme
Most current Chrome
16-inch, 2021 M1 MBP running Tahoe 26.2
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.