diff --git a/src/wp-admin/includes/schema.php b/src/wp-admin/includes/schema.php
index ceb1011462..d78a735cb5 100644
a
|
b
|
function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam |
1044 | 1044 | ) |
1045 | 1045 | ); |
1046 | 1046 | |
1047 | | $site_user = get_userdata( |
1048 | | (int) $wpdb->get_var( |
1049 | | $wpdb->prepare( |
1050 | | "SELECT meta_value |
1051 | | FROM $wpdb->sitemeta |
1052 | | WHERE meta_key = %s AND site_id = %d", |
1053 | | 'admin_user_id', |
1054 | | $network_id |
1055 | | ) |
1056 | | ) |
1057 | | ); |
1058 | | |
1059 | 1047 | /* |
1060 | 1048 | * When upgrading from single to multisite, assume the current site will |
1061 | 1049 | * become the main site of the network. When using populate_network() |
… |
… |
function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam |
1064 | 1052 | * created. |
1065 | 1053 | */ |
1066 | 1054 | if ( ! is_multisite() ) { |
| 1055 | $site_user = (int) $wpdb->get_var( |
| 1056 | $wpdb->prepare( |
| 1057 | "SELECT meta_value |
| 1058 | FROM $wpdb->sitemeta |
| 1059 | WHERE meta_key = %s AND site_id = %d", |
| 1060 | 'admin_user_id', |
| 1061 | $network_id |
| 1062 | ) |
| 1063 | ); |
| 1064 | |
1067 | 1065 | $current_site = new stdClass(); |
1068 | 1066 | $current_site->domain = $domain; |
1069 | 1067 | $current_site->path = $path; |
… |
… |
function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam |
1079 | 1077 | ) |
1080 | 1078 | ); |
1081 | 1079 | $current_site->blog_id = $wpdb->insert_id; |
1082 | | update_user_meta( $site_user->ID, 'source_domain', $domain ); |
1083 | | update_user_meta( $site_user->ID, 'primary_blog', $current_site->blog_id ); |
| 1080 | update_user_meta( $site_user, 'source_domain', $domain ); |
| 1081 | update_user_meta( $site_user, 'primary_blog', $current_site->blog_id ); |
1084 | 1082 | |
1085 | 1083 | // Unable to use update_network_option() while populating the network. |
1086 | 1084 | $wpdb->insert( |