[wp-hackers] URI equivalent of locate_template?

Stephen Rider wp-hackers at striderweb.com
Sat Sep 3 21:14:19 UTC 2011

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.

If it doesn't exist, I wonder if I should add such aching to Core.  Or am I just completely missing something obvious?

Stephen Rider

More information about the wp-hackers mailing list