Opened 3 years ago

Last modified 8 months ago

#11642 new enhancement

Allow to define upload path and url in wp-config.php

Reported by: sirzooro Owned by:
Priority: normal Milestone: Future Release
Component: General Version: 2.9
Severity: normal Keywords: needs-patch
Cc: mikeschinkel@…, info@…

Description

When someone wants to move default directories elsewhere, he/she must do work in two places: add defines to wp-config.php and change upload path on settings page. I think it will be good to introduce two new defines: UPLOAD_PATH and UPLOAD_URL_PATH. When they will be defined, WordPress should use them and do not allow to change these on settings page - similarly to home and site url options.

Change History (4)

You can define the upload path in wp-config.php, not the url however. The url is decided based on the relative path you provide for UPLOADS. The constant you would use is UPLOADS, and it is relative to ABSPATH.

From the code:

    if ( defined('UPLOADS') ) {
        $dir = ABSPATH . UPLOADS;
        $url = trailingslashit( $siteurl ) . UPLOADS;
    }
  • Milestone changed from 3.0 to Future Release

UPLOADS is not always the best idea. I'd like the url to be media.example.com/www (on amazon s3) for www.example.com (on my server).

Punting pending patch, though.

  • Cc mikeschinkel@… added
  • Cc info@… added
Note: See TracTickets for help on using tickets.