Changes between Initial Version and Version 1 of Ticket #14840
- Timestamp:
- 09/10/2010 08:12:34 PM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14840 – Description
initial v1 2 2 "MULTISITE“ within wp-config.php. Thus if you don't have multisite support enabled the Constant isn't set and defined(constant("MULTISITE“)) returns false. However on line 89 of the file wp-settings.php the constant "MULTISITE“ is defined and set to „false“ if your wp is not a multisite wp. 3 3 4 <code> 4 {{{ 5 5 // Initialize multisite if enabled. 6 6 if ( is_multisite() ) { … … 10 10 define( 'MULTISITE', false ); 11 11 } 12 </code> 12 }}} 13 13 14 14 Due to this the overwriting of the upload path which is possible by defining the constant "UPLOADS“ doesn't work for the main site because the if clause in in line 2146 of wp-includes/functions.php 15 15 16 <code> 16 {{{ 17 17 if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) { 18 18 $dir = ABSPATH . UPLOADS; 19 19 $url = trailingslashit( $siteurl ) . UPLOADS; 20 20 } 21 </code> 21 }}} 22 22 23 23 isn't true even if the CONSTANT 'UPLOADS' is defined because $main_override is true and thus !$main_override is false. $main_override is true because line 2127 of the same file is in this case true. 24 24 25 <code> 25 {{{ 26 26 $main_override = defined( 'MULTISITE' ) && is_main_site(); 27 </code> 27 }}} 28 28 29 29 From my point of view it would be better to use 30 31 $main_override = constant( 'MULTISITE' )== true&& is_main_site();32 30 {{{ 31 $main_override = MULTISITE && is_main_site(); 32 }}} 33 33 34 34 --------------