Repository navigation
Conversation
Remove editor-added pattern names without re-encoding block attributes, and use WordPress's template folder mapping when replacing local references. Add regression coverage for PHP attributes, metadata-only exports, and test theme isolation. Fixes WordPress#872
elphizu
marked this pull request as ready for review
October 16, 2026 10:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #872
Fixes Save Patterns leaving
metadata.patternNamebehind and missing synced pattern references inside template parts.Why?
Unsynced pattern copies retained editor metadata referencing the authoring site or plugin patterns. Template parts were also searched under
template-parts/instead of using WordPress’s theme folder mapping.How?
get_block_theme_folders()when locating templates and template parts.patternNamein one cleanup pass, including when no saved user patterns remain.Testing Instructions
wp:patternreferences using the exported theme pattern slug.metadata.patternNameis removed while other metadata and content remain intact.Automated verification:
Use of AI Tools
AI assistance: Yes
Tool: OpenAI Codex
Used for: Reviewing the issue, implementing changes, adding regression tests, and PR Description.