[wp-trac] [WordPress Trac] #63869: Add template / template_file arguments to register_taxonomy
WordPress Trac
noreply at wordpress.org
Sun Aug 24 11:18:30 UTC 2025
#63869: Add template / template_file arguments to register_taxonomy
-------------------------+-----------------------------
Reporter: oglekler | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
I had 13 taxonomies (among many others) that are similar to each other and
should have one template. I didn't find a convenient way to assign them
one template. I ended up with 12 more files that I need to just to include
the same template part.
I misspelled one taxonomy, and when this taxonomy was renamed, we found
out that it got the wrong template. I am trying to avoid duplication and
use constants for such things, so renaming a taxonomy can be as simple as
just changing one constant (and making a migration in case this taxonomy
has terms that we want to bring along), but keeping in mind that you have
to rename files as well is not very convenient.
It will be good to have a {{{template}}} argument that can get a template
as register_post_type() has and a {{{template_file}}} that will make it
possible to render this taxonomy via a certain template file no matter how
it is called.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63869>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list