@@ 1940-1943 (lines=4) @@ | ||
1937 | * Honor the value of UPLOADS. This happens as long as ms-files rewriting is disabled. |
|
1938 | * We also sometimes obey UPLOADS when rewriting is enabled -- see the next block. |
|
1939 | */ |
|
1940 | if ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) { |
|
1941 | $dir = ABSPATH . UPLOADS; |
|
1942 | $url = trailingslashit( $siteurl ) . UPLOADS; |
|
1943 | } |
|
1944 | ||
1945 | // If multisite (and if not the main site in a post-MU network) |
|
1946 | if ( is_multisite() && ! ( is_main_network() && is_main_site() && defined( 'MULTISITE' ) ) ) { |
|
@@ 1966-1986 (lines=21) @@ | ||
1963 | $dir .= $ms_dir; |
|
1964 | $url .= $ms_dir; |
|
1965 | ||
1966 | } elseif ( defined( 'UPLOADS' ) && ! ms_is_switched() ) { |
|
1967 | /* |
|
1968 | * Handle the old-form ms-files.php rewriting if the network still has that enabled. |
|
1969 | * When ms-files rewriting is enabled, then we only listen to UPLOADS when: |
|
1970 | * 1) We are not on the main site in a post-MU network, as wp-content/uploads is used |
|
1971 | * there, and |
|
1972 | * 2) We are not switched, as ms_upload_constants() hardcodes these constants to reflect |
|
1973 | * the original blog ID. |
|
1974 | * |
|
1975 | * Rather than UPLOADS, we actually use BLOGUPLOADDIR if it is set, as it is absolute. |
|
1976 | * (And it will be set, see ms_upload_constants().) Otherwise, UPLOADS can be used, as |
|
1977 | * as it is relative to ABSPATH. For the final piece: when UPLOADS is used with ms-files |
|
1978 | * rewriting in multisite, the resulting URL is /files. (#WP22702 for background.) |
|
1979 | */ |
|
1980 | ||
1981 | if ( defined( 'BLOGUPLOADDIR' ) ) |
|
1982 | $dir = untrailingslashit( BLOGUPLOADDIR ); |
|
1983 | else |
|
1984 | $dir = ABSPATH . UPLOADS; |
|
1985 | $url = trailingslashit( $siteurl ) . 'files'; |
|
1986 | } |
|
1987 | } |
|
1988 | ||
1989 | $basedir = $dir; |