[wp-trac] [WordPress Trac] #13239: Filter locate_template template_names variable

WordPress Trac noreply at wordpress.org
Wed Feb 12 04:07:29 UTC 2014


#13239: Filter locate_template template_names variable
----------------------------------------+-----------------------
 Reporter:  chrisbliss18                |       Owner:
     Type:  enhancement                 |      Status:  reopened
 Priority:  normal                      |   Milestone:  3.9
Component:  Themes                      |     Version:  3.0
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch 3.3-early commit  |     Focuses:
----------------------------------------+-----------------------

Comment (by MikeSchinkel):

 Replying to [comment:63 rmccue]:
 > I thought you meant something more like: ...

 Why would you want to evaluate the expression `$stylesheet . '/' .
 $template_name` twice?

 > The code currently calls `get_stylesheet_directory()` and
 `get_template_directory()` once per iteration.

 Not for the one the matches, it's called twice.

 > (The `else if ( $filepath = file_exists( $filepath =
 get_template_directory() . '/' . $template_name ) )` line also means
 `$filepath` ends up being `true` rather than the path. :) )

 Doh!  Stupid typo ''(so hard (for me) to get these right the first time.
 It's not for lack of trying.)''

 13239.8a.diff will come next.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/13239#comment:64>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list