-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Template activation: ignore templates not associated with active theme #72029
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
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If 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. |
|
Size Change: +121 B (+0.01%) Total Size: 1.95 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 0e3e18a. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/18223033886
|
justintadlock
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.
After testing, this seems to work as I'd expect.
I created a custom single post template with Twenty Twenty-Five active and tested that it works. When I switched to a new theme, the custom template was automatically deactivated, allowing the new theme's single post template to take precedence. I could then edit my inactive custom template and make it active again.
|
I just cherry-picked this PR to the release/21.8 branch to get it included in the next release: 034caf7 |
#72029) Co-authored-by: ellatrix <[email protected]> Co-authored-by: justintadlock <[email protected]>
What?
See #71735.
Addressing feedback from @justintadlock. When the user switches themes, any active templates that are associated with the previous theme should be ignored.
Why?
Currently templates are often heavily dependent on styles and patterns from the current theme.
How?
Whenever new templates are created, we already save information to the database that associates it with the current theme. Fixing the issue is just a matter of using that data:
Please note: when you switched themes previously in WP, theme template edits would completely disappear.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast