[wp-hackers] URI equivalent of locate_template?

John Blackbourn johnbillion+wp at gmail.com
Sat Sep 3 21:56:05 UTC 2011


On 3 September 2011 22:14, Stephen Rider <wp-hackers at striderweb.com> wrote:
> Hi --
>
> 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.

John


More information about the wp-hackers mailing list