WordPress.org

Make WordPress Core

Changes between Version 3 and Version 4 of Ticket #23483, comment 12


Ignore:
Timestamp:
07/08/2017 12:41:31 AM (22 months ago)
Author:
natejacobson
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23483, comment 12

    v3 v4  
    33The site subdirectory in multisite is present in the attachment url when a custom UPLOADS directory is specified. The upload succeeds, but the attachment url is incorrect and hence attachments fail to load.
    44
    5 Is a RewriteRule the only hope?
    6 
    7 Nate
    8 
    95---
    106
    117'''Update'''
    12 After trying a host of other functions and filters to remedy the problem, what worked for me was simply this in functions.php:
     8After trying a host of other functions and filters to remedy the problem, what worked for me was making no UPLOADS declaration in wp-config.php and simply this in functions.php:
    139
    1410{{{#!php
    15 update_option('upload_url_path', $_SERVER['HTTP_HOST'].'/media');
     11   update_option( 'upload_path', ABSPATH.'/media' );
     12   update_option( 'upload_url_path', network_home_url('/media') );
    1613}}}
    1714