Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#16994 closed enhancement (duplicate)

Add filter to array of template files to locate

Reported by: johnbillion's profile johnbillion Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Template Keywords: has-patch
Focuses: Cc:


It's not possible to modify the array of template files that's looped over in order to locate the template file to use on a site.

These arrays are set in the various get_whatever_template() functions (eg get_taxonomy_template(), get_archive_template(), get_home_template()).

A theme framework I'm building adds several new possible template files. Some of these have higher priority than existing templates, and some have lower. Currently I have to use the template_include filter and pass an array of possible template files through locate_template() again due to the varying priority of the templates.

If there was a filter on the array used in get_query_template() this would be easy and would remove the need for locate_template() to be called twice.

Attachments (1)

16994.patch (429 bytes) - added by johnbillion 13 years ago.

Download all attachments as: .zip

Change History (3)

13 years ago

#1 @johnbillion
13 years ago

  • Keywords has-patch added
  • Version set to 3.1


#2 @scribu
13 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.