[wp-hackers] Proposal: standardize plugin-data path

Stephen Rider wp-hackers at striderweb.com
Wed Oct 1 12:23:41 GMT 2008

It appears that the upload folder setting is parsed relative to  
ABSPATH, rather than web root.  So, if I move wp-content out of the wp  
folder, it's then impossible to set the uploads folder to be in wp- 

Site is at example.com, but WP files are at example.com/wp.

Contents folder is example.com/wp-content.

Setting uploads folder to wp-content/uploads, that ends up pointing to  
example.com/wp/wp-content/uploads/.  I want it to point to example.com/ 
wp-content/uploads/ instead....

We've abstracted everything else so that people can move everything  
custom (wp-content, wp-config.php) out of the folder with the actual  
WP files (which makes updates soooooo much better thanks).  It appears  
we need to do the same for the uploads folder.


On Sep 26, 2008, at 1:24 PM, Otto wrote:

> By the year/month thing, I mean that the upload dir automatically
> appends the year/month folder names if that option is enabled.
> However, that just shows what I get for not paying attention.
> wp_upload_dir() returns an array, not a string. And that array
> includes both the directory with and without those folders attached.
> So, the *real* correct answer is:
> $wud = wp_upload_dir();
> $your_upload_dir = $wud['basedir'] . '/your_plugin_name';
> :)
> On Fri, Sep 26, 2008 at 12:26 PM, Stephen Rider
> <wp-hackers at striderweb.com> wrote:
>> On Sep 26, 2008, at 8:35 AM, Otto wrote:
>>>> Seems to me that the safest place to do this would be
>>>> wp_upload_dir().'/your_plugin_name'
>>> Pardon me, using wp_upload_dir() is a bad idea due to the year/month
>>> thing. Use WP_CONTENT_DIR . '/uploads/your_plugin_name' instead.
>> Otto -- Could you please explain the "year/month thing"?
>> Obviously the existence of wp_upload_dir() indicates that path can  
>> change,
>> and is not necessarily within WP_CONTENT_DIR.
>> Thus, if wp_upload_dir() automatically appends the date, shouldn't  
>> there be
>> a way to prevent this?  wp_upload_dir(false) or somesuch?
>> Stephen
>> --
>> Stephen Rider
>> <http://striderweb.com/>
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list