WordPress.org

Make WordPress Core

Ticket #14670: singlesite.diff

File singlesite.diff, 1.5 KB (added by mikeschinkel, 4 years ago)

Implements a SINGLESITE constant referenced by is_multisite() with an optional loading of sunrise.php if it exists.

  • wp-includes/default-constants.php

     
    6464 
    6565        if ( !defined('SHORTINIT') ) 
    6666                define('SHORTINIT', false); 
     67 
     68        if ( !defined( 'SINGLESITE' ) ) 
     69                define( 'SINGLESITE', ! defined( 'MULTISITE' ) || ! MULTISITE ); 
     70 
    6771} 
    6872 
    6973/** 
  • wp-includes/load.php

     
    622622 * @return bool True if multisite is enabled, false otherwise. 
    623623 */ 
    624624function is_multisite() { 
     625        if ( defined( 'SINGLESITE' ) ) 
     626                return SINGLESITE; 
     627 
    625628        if ( defined( 'MULTISITE' ) ) 
    626629                return MULTISITE; 
    627630 
  • wp-settings.php

     
    1313 * 
    1414 * @since 1.0.0 
    1515 */ 
     16 
    1617define( 'WPINC', 'wp-includes' ); 
    1718 
    1819// Include files required for initialization. 
     
    8687if ( is_multisite() ) { 
    8788        require( ABSPATH . WPINC . '/ms-blogs.php' ); 
    8889        require( ABSPATH . WPINC . '/ms-settings.php' ); 
    89 } elseif ( ! defined( 'MULTISITE' ) ) { 
     90} elseif ( SINGLESITE || ! defined( 'MULTISITE' ) ) { 
    9091        define( 'MULTISITE', false ); 
     92        if ( defined( 'SUNRISE' ) ) 
     93                include_once( WP_CONTENT_DIR . '/sunrise.php' ); 
    9194} 
    9295 
    9396// Stop most of WordPress from being loaded if we just want the basics.