[wp-trac] [WordPress Trac] #13239: Filter locate_template template_names variable
WordPress Trac
noreply at wordpress.org
Mon Mar 25 17:03:10 UTC 2013
#13239: Filter locate_template template_names variable
---------------------------------+-----------------------
Reporter: chrisbliss18 | Owner:
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.6
Component: Themes | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch 3.3-early |
---------------------------------+-----------------------
Comment (by coffee2code):
@meloniq: The comment associated with your patch doesn't justify your
reasoning for placing the filter where you've put it in the function. If
you've seen all the other patches to the ticket, there is no dispute about
having a filter in `locate_template()` since that's what they're all
doing.
Your patch places the filter after the `file_exists()` checks, which means
that when the filter is used, a number of `file_exists()` checks will have
been performed unnecessarily. It also assumes that the file specified via
the filter exists since it won't go through the check itself. You pretty
much lose the template hierarchy fallback approach employed in
`locate_template()`, as well as the ability to easily locate a custom
template in either a parent or child theme.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/13239#comment:42>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list