[wp-hackers] Determining URL from within a plugin

Owen Winkler ringmaster at midnightcircus.com
Wed Jan 25 14:33:32 GMT 2006

Matthew Butt wrote:
> I'm trying to figure out how to work out the URL of a file within a plugin.

$basename = str_replace('\\', '/', 
preg_replace('/^.*wp-content[\\\\\/]plugins[\\\\\/]/', '', __FILE__));
$pluginuri = get_settings('siteurl') . '/wp-content/plugins/' . $basename;

Or something like that there.


More information about the wp-hackers mailing list