Introduce is_multisite(). see #11644

git-svn-id: http://svn.automattic.com/wordpress/trunk@12609 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-01-06 20:19:35 +00:00
parent 5fb2415de1
commit f5e12260d4
7 changed files with 42 additions and 2 deletions

View File

@ -1,6 +1,9 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
$title = __('WordPress MU &rsaquo; Admin'); $title = __('WordPress MU &rsaquo; Admin');
$parent_file = 'wpmu-admin.php'; $parent_file = 'wpmu-admin.php';
@ -11,7 +14,7 @@ add_action( 'admin_head', 'index_css' );
require_once('admin-header.php'); require_once('admin-header.php');
if( is_site_admin() == false ) { if ( is_site_admin() == false ) {
wp_die( __('You do not have permission to access this page.') ); wp_die( __('You do not have permission to access this page.') );
} }

View File

@ -1,5 +1,9 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
if( is_site_admin() == false ) { if( is_site_admin() == false ) {
wp_die( __('You do not have permission to access this page.') ); wp_die( __('You do not have permission to access this page.') );
} }

View File

@ -1,5 +1,9 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
$title = __('WordPress MU &rsaquo; Admin &rsaquo; Site Options'); $title = __('WordPress MU &rsaquo; Admin &rsaquo; Site Options');
$parent_file = 'wpmu-admin.php'; $parent_file = 'wpmu-admin.php';

View File

@ -1,6 +1,9 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
$title = __('WordPress MU &rsaquo; Admin &rsaquo; Blogs'); $title = __('WordPress MU &rsaquo; Admin &rsaquo; Blogs');
$parent_file = 'wpmu-admin.php'; $parent_file = 'wpmu-admin.php';

View File

@ -1,12 +1,16 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
require_once( ABSPATH . WPINC . '/http.php' ); require_once( ABSPATH . WPINC . '/http.php' );
$title = __('WordPress MU &rsaquo; Admin &rsaquo; Upgrade Site'); $title = __('WordPress MU &rsaquo; Admin &rsaquo; Upgrade Site');
$parent_file = 'wpmu-admin.php'; $parent_file = 'wpmu-admin.php';
require_once('admin-header.php'); require_once('admin-header.php');
if( is_site_admin() == false ) { if ( is_site_admin() == false ) {
wp_die( __('You do not have permission to access this page.') ); wp_die( __('You do not have permission to access this page.') );
} }

View File

@ -1,6 +1,9 @@
<?php <?php
require_once('admin.php'); require_once('admin.php');
if ( !is_multisite() )
wp_die( __('Multisite support is not enabled.') );
$title = __('WordPress MU &rsaquo; Admin &rsaquo; Users'); $title = __('WordPress MU &rsaquo; Admin &rsaquo; Users');
$parent_file = 'wpmu-admin.php'; $parent_file = 'wpmu-admin.php';

View File

@ -323,6 +323,20 @@ function is_admin() {
return false; return false;
} }
/**
* Whether Multisite support is enabled
*
* @since 3.0
*
* @return bool True if multisite is enabled, false otherwise.
*/
function is_multisite() {
if ( defined('MULTISITE') )
return true;
return false;
}
if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) { if ( file_exists(WP_CONTENT_DIR . '/object-cache.php') ) {
require_once (WP_CONTENT_DIR . '/object-cache.php'); require_once (WP_CONTENT_DIR . '/object-cache.php');
$_wp_using_ext_object_cache = true; $_wp_using_ext_object_cache = true;
@ -388,6 +402,11 @@ require (ABSPATH . WPINC . '/media.php');
require (ABSPATH . WPINC . '/http.php'); require (ABSPATH . WPINC . '/http.php');
require (ABSPATH . WPINC . '/widgets.php'); require (ABSPATH . WPINC . '/widgets.php');
if ( is_multisite() ) {
require_once( ABSPATH . WPINC . '/ms-functions.php' );
require_once( ABSPATH . WPINC . '/ms-default-filters.php' );
}
if ( !defined('WP_CONTENT_URL') ) if ( !defined('WP_CONTENT_URL') )
define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up define( 'WP_CONTENT_URL', get_option('siteurl') . '/wp-content'); // full url - WP_CONTENT_DIR is defined further up