-
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: allow overriding of theme patterns as well as duplication #55911
Comments
There's a similar conversation happening on this issue - #55469 |
It is a little broader in relation to the lock icon, etc. so I think it is worth keeping this issue for the specific functionality of overriding rather than duplicating, but feel free to close if you don't think we need both. |
Yes, I'd expect these to work exactly like template parts. |
I think this has been discussed in other places, but I have some thoughts on the technical solution for this. The first steps would be to make the When you customize a bundled pattern, a @getdave has already been exploring a similar change for
So it'd be good to try getting that merged first and then explore using the same approach for patterns. The gist of it is:
(In the future it might be an option to move to a |
Just a note to say that in exploring this for Navigation I did consider extending the Posts Controller for Navigation and adding a However the feedback from REST maintainers was that we shouldn't do this just for Navigation and instead we should utilise the existing collections endpoints to fetch by slug and get the 0th record. However, if we have other uses cases perhaps we could explore being able to fetch other posts by slug. |
I think allowing customizations to theme-provided Patterns has potential for some sites, but can imagine plenty of environments (such as ours) where we wouldn't want to allow it. Hopefully that's the kind of thing that could be disabled via code. 🤞 Duplication sounds great, though! |
@MadtownLems That a good thing to call out. There's this related (older) issue - #28895. I also seem to recall a related conversation around template parts here on github, though I can't remember specifics now. #28895 has been added to the Synced Patterns iteration for WordPress 6.7 (Draft). |
What problem does this address?
Currently, it is only possible to duplicate a theme pattern in the site editor pattern library. This creates a completely new pattern that lives in the pattern library in conjunction with the original theme pattern, and changes to it do not impact the places where the original theme pattern is used.
What is your proposed solution?
It would be useful to have another option that replaces the theme patterns with the new custom copy, and changes to this pattern are reflected everywhere that the theme pattern is used in the site. It should also then be possible to revert the pattern back to the original theme version. This would be similar to how template modifications currently work, with any edits to a theme template overriding the original theme template, but with an option to revert the customisations:
The text was updated successfully, but these errors were encountered: