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

WordPress Trac noreply at wordpress.org
Sun Aug 7 09:50:14 UTC 2016


#18302: Improve child theme file inheritance by introducing a function to locate a
file URI
----------------------------------------------+--------------------------
 Reporter:  johnbillion                       |       Owner:  johnbillion
     Type:  enhancement                       |      Status:  reviewing
 Priority:  high                              |   Milestone:  4.7
Component:  Themes                            |     Version:
 Severity:  normal                            |  Resolution:
 Keywords:  has-patch needs-unit-tests early  |     Focuses:  template
----------------------------------------------+--------------------------

Comment (by JakePT):

 Replying to [comment:92 gma992]:
 > Replying to [comment:90 JakePT]:
 > > @gma992 I would assume the correct usage in that case would be:
 > > {{{#!php
 > > echo theme_file_uri('/js/foo.js');
 > > }}}
 >
 > Yes indeed, If '/js/foo.js' is passed as a parameter it pass the test,
 but the intention is to grab only the name of the file, isn't it? not just
 for consistency with similar functions but also because themes or plugins
 can have pretty different folder organization, just guessing here.

 No I don't believe it's supposed to work that way. Neither
 get_template_part() or locate_template() work that way. Besides, the idea
 is to use in the theme, so the theme author would know their own folder
 structure. And a child theme author would be organising the theme the same
 way, as they would when replacing templates or template parts.

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


More information about the wp-trac mailing list