Make WordPress Core

Ticket #14670: singlesite2.diff

File singlesite2.diff, 1.7 KB (added by mikeschinkel, 12 years ago)

Enabled loading of /wp-content/sunrise.php when !defined('MULTISITE') and when MULTISITE==false.

  • wp-includes/ms-settings.php

     
    1818require( ABSPATH . WPINC . '/ms-load.php' );
    1919require( ABSPATH . WPINC . '/ms-default-constants.php' );
    2020
    21 if ( defined( 'SUNRISE' ) )
    22         include_once( WP_CONTENT_DIR . '/sunrise.php' );
     21/** Load /wp-content/sunrise.php for Multisite */
     22wp_load_sunrise();
    2323
    2424/** Check for and define SUBDOMAIN_INSTALL and the deprecated VHOST constant. */
    2525ms_subdomain_constants();
  • wp-settings.php

     
    9090        define( 'MULTISITE', false );
    9191}
    9292
     93// Load /wp-content/sunrise.php for single site installations
     94if ( ! MULTISITE )
     95        wp_load_sunrise();
     96
    9397// Stop most of WordPress from being loaded if we just want the basics.
    9498if ( SHORTINIT )
    9599        return false;
     
    317321 * @since 3.0.0
    318322 */
    319323do_action('wp_loaded');
     324
     325/**
     326 * Load /wp-content/sunrise.php if the constant SUNRISE has been defined and the file exists, die with an error messsage if not.
     327 *
     328 * @since 3.2.0
     329 *
     330 * @uses SUNRISE constant Checks to see if it is set in order to load /wp-content/sunrise.php.
     331 * @uses /wp-content/sunrise.php Loads /wp-content/sunrise.php if SUNRISE constant is defined.
     332 *
     333 */
     334function wp_load_sunrise() {
     335        if ( defined( 'SUNRISE' ) ) {
     336                $sunrise_php = WP_CONTENT_DIR . '/sunrise.php';
     337                if ( !file_exists( $sunrise_php ) )
     338                        wp_die( __( "The constant SUNRISE was defined but the file [{$sunrise_php}] does not exist." ) );
     339                else
     340                        include_once( $sunrise_php );
     341        }
     342}
    320343?>