-
Notifications
You must be signed in to change notification settings - Fork 60
Save all patterns #790
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
Save all patterns #790
Conversation
mikachan
left a comment
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 working on this!
Most test cases are working well:
- Test Case 1: Save All Pattern Types ✅
- Test Case 2: Duplicate Pattern Names ✅
- Test Case 3: Localization Options ✅
- Test Case 4: Image Localization ✅
- Test Case 6: UI Label Update ✅
But Test Case 5: Templates Referencing Patterns seems to break the template file. When I insert a pattern into a template and then save to the theme with localization, the template .html file is updated with <!-- wp:pattern {"slug":"pixl/page"} /-->, but the new template pattern isn't created (pixl/page in this case), which breaks the template in the editor as it can't find the template pattern. The new pattern referenced in the template is added to the theme with the correct contents.
mikachan
left a comment
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've reset my local env and I'm no longer seeing the issue with saving a pattern to a template. Test Case 5 is working well for me now ✅
I think we should bring this in! 🚢
|
This is great! I'm curious what the expectation is when using a synced pattern with overrides? I do this all the time but haven't tested with the latest update yet. |
Enables saving all patterns (both synced and unsynced) to the theme, not just synced patterns. Previously, only synced patterns would be exported when using the "Save Patterns" option.
What Changed
User-Facing Changes:
Technical Changes:
Why?
This allows theme designers to create their own patterns for themes.
Testing Instructions
Test Case 1: Save All Pattern Types
Test Case 2: Duplicate Pattern Names
Test Case 3: Localization Options
- ✅ "Save Patterns"
- ✅ "Localize Text"
Test Case 4: Image Localization
- ✅ "Save Patterns"
- ✅ "Localize Images"
Test Case 5: Templates Referencing Patterns
Test Case 6: UI Label Update