mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Template Hierarchy: Extend to include root taxonomy archives #7989
Draft
ockham
wants to merge
37
commits into
WordPress:trunk
Choose a base branch
from
ockham:add/tax-query-for-all-terms-in-taxonomy-extend-template-hierarchy
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Template Hierarchy: Extend to include root taxonomy archives #7989
ockham
wants to merge
37
commits into
WordPress:trunk
from
ockham:add/tax-query-for-all-terms-in-taxonomy-extend-template-hierarchy
+209
−27
Conversation
This file contains 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
This reverts commit 6150936.
ockham
changed the title
Add/tax query for all terms in taxonomy extend template hierarchy
Template Hierarchy: Extend to include root taxonomy archives
Dec 10, 2024
ockham
force-pushed
the
add/tax-query-for-all-terms-in-taxonomy-extend-template-hierarchy
branch
from
December 10, 2024 19:34
66a05a8
to
41cf11d
Compare
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
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.
WIP. Based on #7271. More details to follow.
Nomenclature
For a given taxonomy
projects
that has terms such asfilm
ortv
:/projects
./projects/film
or/projects/tv
.What
WordPress currently only supports non-root taxonomy routes. They are handled by this part of the template hierarchy:
(With an eventual fallback to
archive.html
and finallyindex.html
, not depicted above.)In #7271, I'm proposing a new flag to
register_taxonomy()
that will allow WordPress to support root taxonomy routes for a given taxonomy; however, that PR doesn't make any changes to the template hierarchy -- instead falling back to the generic archive template (archive.html
).This PR proposes to extend the template hierarchy to include a dedicated template for root taxonomy routes.
How
As discussed in
#13816
, there are two major options for what a root taxonomy archive should display:/projects
shows a list of items calledTV
,Films
, etc, but not the individual posts that have those terms assigned)./projects
shows a list of all posts that have eithertv
orfilm
or any other term from theprojects
taxonomy assigned).While 1. is somewhat more consistent with the existing (non-root) taxonomy templates, a majority of people in
#13816
seem to have been in favor of 2. My own use case would be a template that can be shared by both non-root and root taxonomy routes.I thus believe that we should accommodate for both options.
AFAICS, this is best done by introducing two new templates for the root taxonomy archives that take precedence, and eventually fall back to the (non-root) taxonomy templates, like so:
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.