mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
add upload dir support to switch to blog, props ocean90, see #11998
git-svn-id: http://svn.automattic.com/wordpress/trunk@14510 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f6fa5e51d9
commit
d1a55c286d
@ -2114,6 +2114,7 @@ function path_join( $base, $path ) {
|
|||||||
* @return array See above for description.
|
* @return array See above for description.
|
||||||
*/
|
*/
|
||||||
function wp_upload_dir( $time = null ) {
|
function wp_upload_dir( $time = null ) {
|
||||||
|
global $switched;
|
||||||
$siteurl = get_option( 'siteurl' );
|
$siteurl = get_option( 'siteurl' );
|
||||||
$upload_path = get_option( 'upload_path' );
|
$upload_path = get_option( 'upload_path' );
|
||||||
$upload_path = trim($upload_path);
|
$upload_path = trim($upload_path);
|
||||||
@ -2136,12 +2137,12 @@ function wp_upload_dir( $time = null ) {
|
|||||||
$url = trailingslashit( $siteurl ) . $upload_path;
|
$url = trailingslashit( $siteurl ) . $upload_path;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) ) {
|
if ( defined('UPLOADS') && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
|
||||||
$dir = ABSPATH . UPLOADS;
|
$dir = ABSPATH . UPLOADS;
|
||||||
$url = trailingslashit( $siteurl ) . UPLOADS;
|
$url = trailingslashit( $siteurl ) . UPLOADS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_multisite() && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) ) {
|
if ( is_multisite() && ( WP_CONTENT_DIR . '/uploads' != ABSPATH . $upload_path ) && ( !isset( $switched ) || $switched === false ) ) {
|
||||||
if ( defined( 'BLOGUPLOADDIR' ) )
|
if ( defined( 'BLOGUPLOADDIR' ) )
|
||||||
$dir = untrailingslashit(BLOGUPLOADDIR);
|
$dir = untrailingslashit(BLOGUPLOADDIR);
|
||||||
$url = str_replace( UPLOADS, 'files', $url );
|
$url = str_replace( UPLOADS, 'files', $url );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user