Account for the old 'main override' in wp_upload_dir() for the main site in a post-MU network by declining to define the UPLOADS constant.
Fixes uploads on the main site of a post-MU network that uses ms-files rewriting. see #19235. git-svn-id: http://core.svn.wordpress.org/trunk@21892 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2a5f553345
commit
4ea9f01296
|
@ -24,15 +24,17 @@ function ms_upload_constants() {
|
|||
if ( ! get_site_option( 'ms_files_rewriting' ) )
|
||||
return;
|
||||
|
||||
/** @since 3.0.0 */
|
||||
// Base uploads dir relative to ABSPATH
|
||||
if ( !defined( 'UPLOADBLOGSDIR' ) )
|
||||
define( 'UPLOADBLOGSDIR', 'wp-content/blogs.dir' );
|
||||
|
||||
/** @since 3.0.0 */
|
||||
if ( !defined( 'UPLOADS' ) ) {
|
||||
// Uploads dir relative to ABSPATH
|
||||
// The main site in a post-MU network uses wp-content/uploads.
|
||||
// This used to be handled in wp_upload_dir() by ignoring UPLOADS for this case. Avoid defining it instead.
|
||||
if ( ! defined( 'UPLOADS' ) ) {
|
||||
if ( ! ( is_main_site() && defined( 'MULTISITE' ) ) )
|
||||
define( 'UPLOADS', UPLOADBLOGSDIR . "/{$wpdb->blogid}/files/" );
|
||||
|
||||
// Uploads dir relative to ABSPATH
|
||||
if ( 'wp-content/blogs.dir' == UPLOADBLOGSDIR && ! defined( 'BLOGUPLOADDIR' ) )
|
||||
define( 'BLOGUPLOADDIR', WP_CONTENT_DIR . "/blogs.dir/{$wpdb->blogid}/files/" );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue