From 74d9ba31591570af0c78fd7ed76e389a2869ed46 Mon Sep 17 00:00:00 2001 From: wpmuguru Date: Thu, 10 Jun 2010 19:37:51 +0000 Subject: [PATCH] allow custom content dir in WP 3.0 main site, fixes #13733 git-svn-id: http://svn.automattic.com/wordpress/trunk@15197 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 94b82e9e53..9606f01646 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2125,14 +2125,13 @@ function wp_upload_dir( $time = null ) { $siteurl = get_option( 'siteurl' ); $upload_path = get_option( 'upload_path' ); $upload_path = trim($upload_path); - $main_override = false; + $main_override = defined( 'MULTISITE' ) && is_main_site(); if ( empty($upload_path) ) { $dir = WP_CONTENT_DIR . '/uploads'; } else { $dir = $upload_path; if ( 'wp-content/uploads' == $upload_path ) { $dir = WP_CONTENT_DIR . '/uploads'; - $main_override = defined( 'MULTISITE' ) && is_main_site(); } elseif ( 0 !== strpos($dir, ABSPATH) ) { // $dir is absolute, $upload_path is (maybe) relative to ABSPATH $dir = path_join( ABSPATH, $dir ); @@ -2146,12 +2145,12 @@ function wp_upload_dir( $time = null ) { $url = trailingslashit( $siteurl ) . $upload_path; } - if ( defined('UPLOADS') && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { + if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) { $dir = ABSPATH . UPLOADS; $url = trailingslashit( $siteurl ) . UPLOADS; } - if ( is_multisite() && ( !$main_override || WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) { + if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) { if ( defined( 'BLOGUPLOADDIR' ) ) $dir = untrailingslashit(BLOGUPLOADDIR); $url = str_replace( UPLOADS, 'files', $url );