-
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
Site Editor: Add theme taxonomy to templates and template parts #27016
Conversation
Size Change: -39 B (0%) Total Size: 1.19 MB
ℹ️ View Unchanged
|
Thanks for this. I just have a few questions:
What's the purpose of this? Is it necessary? It would conflict if there happened to be a theme called
I want to be able to keep the ones I already have and have them automatically update to the new system. Would it be a good idea to automatically associate templates and parts with the current theme by default, similar to how posts get automatically put in Uncategorized? |
4d0357a
to
5782124
Compare
It will used to differentiate between file-based theme templates and user-created templates.
I've added a function that migrates from meta to taxonomy. Good point there, it would be difficult to ask everyone to start clean 😄 Later on we can remove this function. |
I gathered that much, but I mean where will this differentiation be needed?
Thanks, but I think we could go a step further and implement something permanent. My understanding is theme-less templates and parts are not being supported for the time being, so wouldn't it make sense for there to be some kind of "sanitisation" on saving the post? |
Is this a duplicate of #24720 ? 🤔 |
@aristath, good catch. I was about to ask exactly the same question. As far as I can tell it look nearly identical. |
No need... Yours is up to date and rebasing mine would be a waste of time since we already have this one. |
Thank you! Sorry for hijacking your PR 😅 |
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.
Overall this looks good!
I only found 1 part that was missed, but I didn't want to push directly to your branch so there's a small additional PR against this one here: #27042
2c700e6
to
6bb007c
Compare
Hopefully, perf test is now going to pass. Perf test was failing because we use the same database for testing the |
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.
LGTM! That bug is fixed now.
Hi there! Can we update the architecture docs to reflect these changes? Can we explain the purpose of each of these taxonomies? Also what value the "_wp_file_based" provides? A user might edit the template entirely which might make this taxonomy meaningless. |
@youknowriad Once it's modified, its status will change to anything else (
Without the |
Description
Fixes #24377
Replace theme meta with theme taxonomy. Register a taxonomy called
wp_theme
and use it to store the theme of the template and template parts.A special value is used to mark templates that were created from a theme template file. This value is:
_wp_file_based
.How has this been tested?
Everything should work the same way as before. You will need to start clean. (Delete all templates and template parts)
Types of changes
Breaking change
Checklist: