-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Patterns: Use patterns from the directory in the pattern block. #47880
Comments
Are you thinking it'd always pull from the directory, unless the parent template was edited? |
Yes exactly, the same way that the block works for theme patterns. I think this could be powerful for themes as it means they can assemble a whole from the pattern directory very easily, and if the patterns need updating they will get the updates without doing anything. Simple themes could just be a collection of patterns and styles with no need for custom templates. |
I lean towards an inserted/template-applied pattern being locked to the theme/site—not editable from the Pattern Directory. It may introduce more issues than its worth (patterns updates that disrupt the site). I'm also not sure if this functionality would be used much. Maybe for headers, but most other patterns would be manipulated before publishing imo. |
My main thought was for headers, footers and query patterns. It would be powerful to be able to create a whole site just by reusing patterns from the directory. The approach would also have some maintenance benefits - any updates done to the patterns in the directory would immediately benefit the theme. |
What problem does this address?
The pattern block loads patterns based on a slug:
<!-- wp:pattern {"slug":"core/simple-header"} /-->
This works when the pattern is in the theme, but if the pattern comes from the directory it only works in the editor, not in the front end. To reproduce, add this to the header.html of your active theme:
<!-- wp:pattern {"slug":"core/simple-header"} /-->
Load the site editor - you'll see the pattern.
Load the front end - the pattern is missing.
The text was updated successfully, but these errors were encountered: