Ticket #14670: singlesite.diff

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

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

Line 
1Index: wp-includes/default-constants.php
2===================================================================
3--- wp-includes/default-constants.php   (revision 17644)
4+++ wp-includes/default-constants.php   (working copy)
5@@ -64,6 +64,10 @@
6 
7        if ( !defined('SHORTINIT') )
8                define('SHORTINIT', false);
9+
10+       if ( !defined( 'SINGLESITE' ) )
11+               define( 'SINGLESITE', ! defined( 'MULTISITE' ) || ! MULTISITE );
12+
13 }
14 
15 /**
16Index: wp-includes/load.php
17===================================================================
18--- wp-includes/load.php        (revision 17644)
19+++ wp-includes/load.php        (working copy)
20@@ -622,6 +622,9 @@
21  * @return bool True if multisite is enabled, false otherwise.
22  */
23 function is_multisite() {
24+       if ( defined( 'SINGLESITE' ) )
25+               return SINGLESITE;
26+
27        if ( defined( 'MULTISITE' ) )
28                return MULTISITE;
29 
30Index: wp-settings.php
31===================================================================
32--- wp-settings.php     (revision 17644)
33+++ wp-settings.php     (working copy)
34@@ -13,6 +13,7 @@
35  *
36  * @since 1.0.0
37  */
38+
39 define( 'WPINC', 'wp-includes' );
40 
41 // Include files required for initialization.
42@@ -86,8 +87,10 @@
43 if ( is_multisite() ) {
44        require( ABSPATH . WPINC . '/ms-blogs.php' );
45        require( ABSPATH . WPINC . '/ms-settings.php' );
46-} elseif ( ! defined( 'MULTISITE' ) ) {
47+} elseif ( SINGLESITE || ! defined( 'MULTISITE' ) ) {
48        define( 'MULTISITE', false );
49+       if ( defined( 'SUNRISE' ) )
50+               include_once( WP_CONTENT_DIR . '/sunrise.php' );
51 }
52 
53 // Stop most of WordPress from being loaded if we just want the basics.