[wp-trac] [WordPress Trac] #18302: Improve child theme file inheritance by introducing `theme_url()` to locate a file URI

WordPress Trac wp-trac at lists.automattic.com
Wed Sep 5 21:47:54 UTC 2012


#18302: Improve child theme file inheritance by introducing `theme_url()` to locate
a file URI
-------------------------------------------------+-------------------------
 Reporter:  johnbillion                          |       Owner:  westi
     Type:  enhancement                          |      Status:  reviewing
 Priority:  normal                               |   Milestone:  3.5
Component:  Template                             |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch westi-likes needs-unit-    |
  tests                                          |
-------------------------------------------------+-------------------------

Comment (by scribu):

 Replying to [comment:38 Otto42]:
 > `function theme_url($path='', $theme='')` : Gets the URL to a specified
 file ($path) in the current theme, accounting for existence of the file in
 the child/parent situation (child if exists, parent if not). If the $theme
 is specified via the slug (or `__FILE__`), then the child/parent is not
 accounted for, using the specified theme directly.

 -1 on passing the theme slug as a parameter. There's only one parent theme
 and possibly one child theme running at a time; we should continue to take
 advantage of that.

 So, the `$theme` parameter should only take two values: 'child' or
 'parent'.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18302#comment:39>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list