[wp-trac] [WordPress Trac] #18298: deprecate TEMPLATEPATH and STYLESHEETPATH

WordPress Trac noreply at wordpress.org
Fri Jun 6 22:23:16 UTC 2014


#18298: deprecate TEMPLATEPATH and STYLESHEETPATH
---------------------------+-----------------------------
 Reporter:  aaroncampbell  |       Owner:  wonderboymusic
     Type:  enhancement    |      Status:  reopened
 Priority:  normal         |   Milestone:  4.0
Component:  Themes         |     Version:  3.0
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  template
---------------------------+-----------------------------
Changes (by nacin):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 I've always thought this was a bit silly, but didn't care enough to
 complain (and, of course, I like making things more testable). However,
 I've noticed we've now greatly increased what gets executed with the
 inclusion of functions.php and every theme template file. In the case of
 including functions.php, we're running each function twice (via
 is_child_theme(), too). These functions are definitely not as cheap as a
 constant — they inclusively run three filters and a get_option() call
 (five if multiple theme roots are in play).

 I have not yet run any kind of profiling on this.

 Eliminating TEMPLATEPATH and STYLESHEETPATH was designed to make things
 more testable, I get that. But that doesn't apply to wp-settings.php, for
 example. This also exposes the ability to tinker with locate_template() by
 filtering the theme directory itself, which seems pretty scary. And, the
 changes in locate_template() mean these functions are called in a loop,
 rather than outside of it, especially problematic because it could be
 called up to four times per iteration even though the values might be the
 same (in the case of no child theme).

 I just want to make sure we know what we're getting into, and also
 optimize for the fact that we're now dealing with dynamic code so we need
 to be more mindful of how we're writing our control structures.

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


More information about the wp-trac mailing list