[wp-hackers] best method for figuring out where a plugin is.
Aaron Harun
admin at anthologyoi.com
Mon Apr 14 00:21:17 GMT 2008
Here is a modified version of the function I use:
function get_base(){
$base = end(explode('/',
str_replace(array('\\','/widgetprofiles.php'),array('/',''),__FILE__)));
if($base = 'plugins'){$base = '';}
return $base;
}
It strips the file names, applies some windows fixes, explodes it on
the '/'s and then takes the last one. It kinda uses the long way, but
I was having issues using just the directory name function on some
set-ups. With this code, I've never had a problem on any set-up.
Aaron.
More information about the wp-hackers
mailing list