WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 14 months ago

#11642 reopened enhancement

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

Reported by: sirzooro Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.9
Component: Upload Keywords: needs-patch
Focuses: Cc:

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 (7)

comment:1 @sivel5 years ago

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;
    }

comment:2 @Denis-de-Bernardy5 years ago

  • 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.

comment:3 @mikeschinkel5 years ago

  • Cc mikeschinkel@… added

comment:4 @toscho3 years ago

  • Cc info@… added

comment:5 @nacin15 months ago

  • Component changed from General to Upload

comment:6 follow-up: @jbkkd14 months ago

  • Resolution set to invalid
  • Status changed from new to closed

This option does not exist anymore on the Settings page.

comment:7 in reply to: ↑ 6 @nacin14 months ago

  • Resolution invalid deleted
  • Status changed from closed to reopened

Replying to jbkkd:

This option does not exist anymore on the Settings page.

Correct, but there is still a need to modify these values. I'm still for a patch here. UPLOADS is pretty lame.

Note: See TracTickets for help on using tickets.