Pattern postTypes
no longer honored
#52717
Labels
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
Needs Testing
Needs further testing to be confirmed.
[Type] Bug
An existing feature does not function as intended
Description
In my block theme I set
'postTypes' => [ 'wp_template', 'wp_template_part' ]
(viaregister_block_pattern()
PHP function) for all patterns that are meant to be used in Site Editor only (they should not be used in page block editor).Then I insert such pattern into a Template Part with
<!-- wp:pattern {"slug":"my-theme/site/header"} /-->
, for example.Everything is working perfectly fine with WordPress 6.2.2 - the site header pattern is correctly rendered when editing site header template part in Site Editor.
However, when I activate Gutenberg 16.2.1, the pattern is not rendered at all in Site Editor when editing related template part. The pattern is not available via block/pattern inserter either.
I've traced the issue down to setting up the
postTypes
attribute. Once I remove this attribute from the pattern registration arguments, the pattern renders OK.Please check and fix this functionality. I think it should still work the same as it does with WP6.2.
Step-by-step reproduction instructions
The description says it all.
Screenshots, screen recording, code snippet
No response
Environment info
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
The text was updated successfully, but these errors were encountered: