[wp-hackers] Re: Rename plugin directory name

Lutz Schröer latz at elektroelch.de
Wed Apr 2 12:33:13 GMT 2008


DD32 wrote:
> I guess this entire problem is coming up as you're hard-coding a 
> plugin foldername into your plugin files?
This is the only solution that works on ALL systems.
> Here is some code i've used before to determine the folder WP is 
> installed in: $folder = dirname(plugin_basename(__FILE__));
> (That code is off the top of my head, but should be allright)
I've used a similar function in my plugin for some time and it worked on 
almost all installations but some seemed to have difficulties with this 
code so it was not fully satisfactory and I switched back to a hard 
coded folder name.
> In a smilar fashion, theres a trac ticket for adding plugin_url to 
> return something like http://.../wp-content/plugins/my-plugin-folder/
Such a function would be really helpful (if it works in all/most 
situations possible). Well the milestone set to 2.7 so it's gonna take 
some time...
> Its possible to get the folders changed though, just required a 
> wp-plugins.org admin to do it though i think.
I'm afraid that's true. Still I would appreciate the possibility to 
change the name by myself. I think there are quite a few authors who 
want to change the name of their plugins over the time.

At least I'm happy to see that I'm not the only one struggling with this 
issue.

Latz


More information about the wp-hackers mailing list