[wp-trac] [WordPress Trac] #37743: Setting UPLOADS constant's path prefixes the path with ABSPATH instead of WP_CONTENT_DIR

WordPress Trac noreply at wordpress.org
Fri Aug 19 23:43:01 UTC 2016


#37743: Setting UPLOADS constant's path prefixes the path with ABSPATH instead of
WP_CONTENT_DIR
--------------------------+----------------------
 Reporter:  jtwebb        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Media         |     Version:  4.6
 Severity:  normal        |  Resolution:  wontfix
 Keywords:                |     Focuses:
--------------------------+----------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => wontfix
 * component:  General => Media
 * milestone:  Awaiting Review =>


Comment:

 Hi @jtwebb,

 We can't change the behaviour of the `UPLOADS` constant, as it's
 documented to be relative to `ABSPATH`.

 The options you have available to you are:
  - Set `UPLOADS` for relative to `ABSPATH`
  - Set `WP_CONTENT_DIR` and have the uploads live at
 `WP_CONTENT_DIR/uploads`
  - Use the `upload_path` and `upload_dir` options within WordPress, which
 ''may'' be absolute OR relative to `ABSPATH`. (See Settings -> Media)
  - Use the `upload_dir` filter and set it to something completely custom

 With those options available to you, I don't think we're going to add a
 new constant for an absolute path to the uploads directory.
 WordPress encourages the usage of filters over constants, as they're much
 more flexible, and the options allow changing it for most other use-cases.
 While I'm marking this ticket as `wontfix` it's possible to continue
 discussion, and a Trac gardener can re-open it if needed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37743#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list