Repository navigation
Export user created templates and template parts to custom directories - #84080
Open
sarthaknagoshe2002 wants to merge 1 commit into
Open
sarthaknagoshe2002 wants to merge 1 commit into
sarthaknagoshe2002 wants to merge 1 commit into
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Updated as activity occurs, without notifying anyone named here. Add the 🏷️ LabelsThis pull request needs exactly one label indicating its type, and has 0.
Read more about Type labels in Gutenberg. If you cannot add labels yourself, a reviewer can do it for you. |
sarthaknagoshe2002
marked this pull request as ready for review
October 5, 2026 13:22
This branch has not been deployed
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 #72515
This PR updates the Site Editor's "Export Theme" functionality to properly separate purely custom, user created templates and template parts from standard theme files. User created files are now routed to
custom-templates/andcustom-parts/directories within the exported zip, accompanied by aCUSTOM-TEMPLATES-README.txtmanifest.Why?
With the introduction of the new Template API, there is a strict distinction between default theme templates and custom user generated templates. Previously, custom templates were mixed into the
templates/andparts/directories alongside theme files, or completely ignored. This caused confusion and made it difficult for developers to identify which files were user generated in order to merge them back into their source controlled themes.How?
gutenberg_get_template_export_directory()to classify templates.custom-templates/andcustom-parts/.templates/andparts/.CUSTOM-TEMPLATES-README.txtat the root of the archive outlining how developers can adopt these custom files, including noting which ones need acustomTemplatesentry intheme.json.Tests_Block_Template_Export) covering all routing, skipping, and formatting scenarios.Testing Instructions
my-custom-template). Add a few blocks and save.custom-templates/directory, the custom part is inside acustom-parts/directory, and your modified theme template is inside the standardtemplates/directory.CUSTOM-TEMPLATES-README.txtand verify it correctly lists your custom files and instructions for adopting them.Use of AI Tools
AI assistance was used for scaffolding the PHPUnit test suite and formatting the layout and text of the CUSTOM-TEMPLATES-README.txt manifest. All AI generated code, assertions, and documentation were manually reviewed, verified, and adjusted to strictly adhere to WordPress Core standards.