[wp-hackers] URI equivalent of locate_template?

Stephen Rider wp-hackers at striderweb.com
Sat Sep 3 22:29:47 UTC 2011


Perfecto! Thanks.


On Sep 3, 2011, at 4:56 PM, John Blackbourn wrote:

> On 3 September 2011 22:14, Stephen Rider <wp-hackers at striderweb.com> wrote:
>> I'm trying to link a CSS file that may or may not existing the Theme directory.  I can use locate_template() to determine if the file exists, but I can't find a clean way to get the URI of the file for the actual link.
>> 
>> Is there a URI equivalent of locate_template?  That is, I want to pass the name of e.g. myfile.css, and have a function that looks for it in a child directory (if applicable) then look in the parent/main theme directory, and return either a URI for the file, or empty string if it isn't found.
> 
> No there isn't but there totally should be. See
> http://core.trac.wordpress.org/ticket/18302 which is scheduled for
> 3.3.



More information about the wp-hackers mailing list