tables( 'ms_global' ) as $table => $prefixed_table )
$wpdb->$table = $prefixed_table;
/**
* Check for an existing network.
*
* @since 3.0.0
* @return Whether a network exists.
*/
function network_domain_check() {
global $wpdb;
if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpdb->site'" ) )
return $wpdb->get_var( "SELECT domain FROM $wpdb->site ORDER BY id ASC LIMIT 1" );
return false;
}
/**
* Allow subdomain install
*
* @since 3.0.0
* @return bool - whether subdomain install is allowed
*/
function allow_subdomain_install() {
$path = preg_replace( '|https?://[^/]|', '', get_option( 'siteurl' ) );
if( strlen( $path ) > 1 || 'localhost' == $_SERVER[ 'HTTP_HOST' ] )
return false;
return true;
}
/**
* Get base domain of network.
*
* @since 3.0.0
* @return string Base domain.
*/
function get_clean_basedomain() {
if ( $existing_domain = network_domain_check() )
return $existing_domain;
$domain = preg_replace( '|https?://|', '', get_option( 'siteurl' ) );
if ( $slash = strpos( $domain, '/' ) )
$domain = substr( $domain, 0, $slash );
return $domain;
}
if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) )
wp_die( __( 'You must define the WP_ALLOW_MULTISITE
constant as true in your wp-config.php file to allow creation of a Network.' ) );
$title = __( 'Create a Network of WordPress Sites' );
$parent_file = 'tools.php';
// @todo: Documentation?
// add_contextual_help( $current_screen, ... );
include( './admin-header.php' );
?>
Caution: We recommend you backup your existing wp-config.php
and .htaccess
files.' ); ?>
blogs.dir directory in %s
. This directory is used to stored uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR ); ?>
wp-config.php file in %s
:' ), ABSPATH ); ?>
wp-config.php file.', 'These unique authentication keys are also missing from your wp-config.php
file.', $num_keys_salts ); ?>
.htaccess file in %s
, replacing other WordPress rules:' ), ABSPATH ); ?>