-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pattern postTypes
no longer honored
#52717
Comments
Thanks for reporting this issue @webmandesign! I tested and confirmed that the issue was present in Gutenberg 16.2.1, and has been resolved in Since this fix will be rolled out to both Gutenberg 16.3 and WP 6.3, I'll close out this issue now. |
@andrewserong Perfect! Thanks for fast resolution. |
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: