-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Update curating the editor to include starter patterns for templates #53398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for always making sure this guide is up to date :)
|
||
In the same way patterns can be prioritized for new posts or pages, the same experience can be added to the template creation process. When patterns declare support for the 'templateTypes' property, the patterns will appear anytime a template that matches the designation are created along with the options to start from a blank state or use the current fallback of the template. By default, WordPress does not include any of these patterns. | ||
|
||
To opt into this, a pattern needs to specify a property called `templateTypes`, which is an array containing the templates where the patterns can be used as the full content. [Here's an example](https://gist.github.com/annezazu/99ce2f84fa033dae48eacc50a8287bae) of a pattern that would appear when creating a 404 template. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still always find it confusing whether to reference the properties in the form for manually registering patterns via the register_block_pattern
function or the way it should be added to the comment header in file inside the patterns/
directory of a theme... Template Types
or templateTypes
=D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great call out. I think that should be addressed elsewhere though, like the Theme Handbook, and we can link off. Going to leave for now but keep it in mind :)
What?
This updates the curating the editor doc to include the 6.3 update around starter patterns for templates ahead of the 6.3 release.
Why?
To keep the docs up to date :)