Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #14840


Ignore:
Timestamp:
09/10/2010 08:12:34 PM (15 years ago)
Author:
nacin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14840 – Description

    initial v1  
    22"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.
    33
    4 <code>
     4{{{
    55// Initialize multisite if enabled.
    66if ( is_multisite() ) {
     
    1010        define( 'MULTISITE', false );
    1111}
    12 </code>
     12}}}
    1313
    1414Due 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
    1515
    16 <code>
     16{{{
    1717if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
    1818                $dir = ABSPATH . UPLOADS;
    1919                $url = trailingslashit( $siteurl ) . UPLOADS;
    2020        }
    21 </code>
     21}}}
    2222
    2323 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.
    2424
    25 <code>
     25{{{
    2626$main_override = defined( 'MULTISITE' ) && is_main_site();
    27 </code>
     27}}}
    2828
    2929From 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}}}
    3333
    3434--------------