WordPress.org

Make WordPress Core

Ticket #11644: 11644.diff

File 11644.diff, 3.8 KB (added by ryan, 8 years ago)

Introduce is_multisite()

  • wp-settings.php

     
    323323        return false;
    324324}
    325325
     326/**
     327 * Whether Multisite support is enabled
     328 *
     329 * @since 3.0
     330 *
     331 * @return bool True if multisite is enabled, false otherwise.
     332 */
     333function is_multisite() {
     334        if ( defined('MULTISITE') )
     335                return true;
     336
     337        return false;
     338}
     339
    326340if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
    327341        require_once (WP_CONTENT_DIR . '/object-cache.php');
    328342        $_wp_using_ext_object_cache = true;
     
    388402require (ABSPATH . WPINC . '/http.php');
    389403require (ABSPATH . WPINC . '/widgets.php');
    390404
     405if ( is_multisite() ) {
     406        require_once( ABSPATH . WPINC . '/ms-functions.php' );
     407        require_once( ABSPATH . WPINC . '/ms-default-filters.php' );
     408}
     409
    391410if ( !defined('WP_CONTENT_URL') )
    392411        define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up
    393412
  • wp-admin/ms-edit.php

     
    11<?php
    22require_once('admin.php');
     3
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    37if( is_site_admin() == false ) {
    48        wp_die( __('You do not have permission to access this page.') );
    59}
  • wp-admin/ms-sites.php

     
    11<?php
    22require_once('admin.php');
    33
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    47$title = __('WordPress MU &rsaquo; Admin &rsaquo; Blogs');
    58$parent_file = 'wpmu-admin.php';
    69
  • wp-admin/ms-upgrade-site.php

     
    11<?php
    22require_once('admin.php');
     3
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    37require_once( ABSPATH . WPINC . '/http.php' );
    48
    59$title = __('WordPress MU &rsaquo; Admin &rsaquo; Upgrade Site');
    610$parent_file = 'wpmu-admin.php';
    711require_once('admin-header.php');
    812
    9 if( is_site_admin() == false ) {
     13if ( is_site_admin() == false ) {
    1014    wp_die( __('You do not have permission to access this page.') );
    1115}
    1216
  • wp-admin/ms-users.php

     
    11<?php
    22require_once('admin.php');
    33
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    47$title = __('WordPress MU &rsaquo; Admin &rsaquo; Users');
    58$parent_file = 'wpmu-admin.php';
    69
  • wp-admin/ms-admin.php

     
    11<?php
    22require_once('admin.php');
    33
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    47$title = __('WordPress MU &rsaquo; Admin');
    58$parent_file = 'wpmu-admin.php';
    69
     
    1114
    1215require_once('admin-header.php');
    1316
    14 if( is_site_admin() == false ) {
     17if ( is_site_admin() == false ) {
    1518        wp_die( __('You do not have permission to access this page.') );
    1619}
    1720
  • wp-admin/ms-options.php

     
    11<?php
    22require_once('admin.php');
     3
     4if ( !is_multisite() )
     5        wp_die( __('Multisite support is not enabled.') );
     6
    37$title = __('WordPress MU &rsaquo; Admin &rsaquo; Site Options');
    48$parent_file = 'wpmu-admin.php';
    59