[wp-hackers] plugins_url function

Phillip Lord phillip.lord at newcastle.ac.uk
Wed Dec 14 15:20:07 UTC 2011


John Blackbourn <johnbillion+wp at gmail.com> writes:

> On 13 December 2011 14:30, Phillip Lord <phillip.lord at newcastle.ac.uk> wrote:
>> Okay, that's not ideal for me. In practice, I think it's easier to
>> unwind the symlinks -- or just turn them around, so that the real
>> directory is under wp-content/plugins then I symlink to this for ease.
>
> Yeah reversing the symlinks can work, depending on the situation. More
> commonly though I'll have a plugin in one central location which I
> want to symlink to multiple installs.

Yeah, I think that would be the most common use case. You could
hard-link, if you are within one filesystem. 


> Out of interest, what do you mean by unwinding the symlink? If you
> mean resolving the symlink, then unfortunately it can't be done in PHP
> (see Otto's PHP bug link).

I meant remove the symlink and stick the real directory there. 


>
> Re-reading your first email - If you're keeping all of your plugins in
> a separate directory then you can just define the WP_PLUGINS_DIR and
> WP_PLUGINS_URL constants so they point at your ~/wordpress-plugins
> directory, and then you don't need to bother with symlinks at all. I
> do this on my dev box where I have many WordPress installs and just
> one directory that contains the plugins.

I don't do this. Basically, I have some plugins where I want to track
versions by svn installed through symlinks. It's pretty much there for
historical reasons, so easy enough to remove. I just wanted to be sure
that it's not a flaw in my plugin; it doesn't appear to be. It's just a
gotcha. 

Phil


More information about the wp-hackers mailing list