From c2bb5992ee744f558a4e9f66579321b731114828 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 10 Mar 2010 08:34:42 +0000 Subject: [PATCH] Store subdomain/subdirectory choice in sitemeta. For now, only used in case we return to network.php without constants. see #11816 git-svn-id: https://develop.svn.wordpress.org/trunk@13642 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/schema.php | 3 ++- wp-admin/network.php | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/schema.php b/wp-admin/includes/schema.php index 875caf4614..0f8779e305 100644 --- a/wp-admin/includes/schema.php +++ b/wp-admin/includes/schema.php @@ -702,7 +702,8 @@ Thanks! // @todo - network admins should have a method of editing the network siteurl (used for cookie hash) 'siteurl' => get_option( 'siteurl' ), 'add_new_users' => '0', - 'upload_space_check_disabled' => '0' + 'upload_space_check_disabled' => '0', + 'subdomain_install' => intval( $subdomain_install ), ); $insert = ''; diff --git a/wp-admin/network.php b/wp-admin/network.php index 8b31268fc5..1bb7b5753b 100644 --- a/wp-admin/network.php +++ b/wp-admin/network.php @@ -168,23 +168,29 @@ function network_step1() { */ function network_step2() { global $base, $wpdb; + $hostname = get_clean_basedomain(); if ( $_POST ) { - $vhost = (bool) $_POST['subdomain_install']; + $vhost = 'localhost' == $hostname ? false : (bool) $_POST['subdomain_install']; } else { if ( is_multisite() ) { $vhost = is_subdomain_install(); ?>

get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" ); ?>

+

Caution: We recommend you backup your existing wp-config.php and .htaccess files.' ); ?>

    @@ -194,7 +200,7 @@ function network_step2() { define( 'MULTISITE', true ); define( 'VHOST', '' ); $base = ''; -define( 'DOMAIN_CURRENT_SITE', '' ); +define( 'DOMAIN_CURRENT_SITE', '' ); define( 'PATH_CURRENT_SITE', '' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 );