Make WordPress Core


Ignore:
Timestamp:
10/12/2012 10:05:02 PM (12 years ago)
Author:
nacin
Message:

Have wp_upload_dir() account for blog switching, ms-files rewriting, and the UPLOADS constant properly. This type of logic needs a lot of code comments.

Prevents wp_upload_dir() from obeying the UPLOADS constant when ms-files rewriting is enabled and a blog is switched.

Reverts [22106] thanks to [22108].

see #19235.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-default-constants.php

    r21892 r22222  
    2929        define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
    3030
    31     // The main site in a post-MU network uses wp-content/uploads.
    32     // This used to be handled in wp_upload_dir() by ignoring UPLOADS for this case. Avoid defining it instead.
     31    // Note, the main site in a post-MU network uses wp-content/uploads.
     32    // This is handled in wp_upload_dir() by ignoring UPLOADS for this case.
    3333    if ( ! defined( 'UPLOADS' ) ) {
    34         if ( ! ( is_main_site() && defined( 'MULTISITE' ) ) )
    35             define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
     34        define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
    3635
    3736        // Uploads dir relative to ABSPATH
Note: See TracChangeset for help on using the changeset viewer.