Open smile-matt-oakley opened 7 months ago
Hi, This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps. Thanks for helping out.
Description
The Issue and context
I have a theme that defines a whitelist of blocks using the filter,
allowed_block_types_all
, in this whitelist I allow the blockcore/columns
. This successfully allows columns to be used in the editor, this also allowed the blockcore/column
to be used, even if not specifically specified in the whitelist. This works as personally expected.However I recently started registering patterns using
register_block_pattern()
. Our patterns included a 50/50 columns block which included the child column block. When these blocks are passed to theregister_block_pattern()
the function returns true that the patterns successfully registered, but upon loading the pattern library the patterns failed to appear.After digging around I found that if you if do not specifically include
core/column
in the whitelist the pattern will register "successfully" (according to the functions return) but will fail to register as a selectable pattern. Only once adding thecore/column
to the whitelist will the pattern then actually be registered successfully and be available for use in the editor.This caused great confusion as using just
core/columns
enabled both the "column" and "columns" in the editor experience, however when registering patterns the pattern failed to register silently.I propose that either of the following:
core/columns
block is whitelisted it also recongisescore/column
as a whitelisted block.register_block_pattern()
returns an error specifying that the pattern you are attempting to register includes blocks that are not in the whitelist.Step-by-step reproduction instructions
allowed_block_types_all
and only addcore/columns
register_block_pattern()
core/column
Screenshots, screen recording, code snippet
No response
Environment info
Wordpress version 6.4.3
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes