Make WordPress Core

Opened 5 months ago

#63869 new enhancement

Add template / template_file arguments to register_taxonomy

Reported by: oglekler's profile oglekler Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: Cc:

Description

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.

Change History (0)

Note: See TracTickets for help on using tickets.