Skip to content

Commit

Permalink
Adjust IDENTITY_INSERT while creating first entry in wp_blogs
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickebates committed Apr 19, 2019
1 parent 63cd101 commit 7a69d5b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wp-admin/includes/schema.php
Expand Up @@ -1112,6 +1112,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
$current_site->domain = $domain;
$current_site->path = $path;
$current_site->site_name = ucfirst( $domain );
sqlsrv_query( $wpdb->dbh, "SET IDENTITY_INSERT $wpdb->blogs ON" );
$wpdb->insert(
$wpdb->blogs,
array(
Expand All @@ -1123,6 +1124,7 @@ function populate_network( $network_id = 1, $domain = '', $email = '', $site_nam
)
);
$current_site->blog_id = $wpdb->insert_id;
sqlsrv_query( $wpdb->dbh, "SET IDENTITY_INSERT $wpdb->blogs OFF" );
update_user_meta( $site_user->ID, 'source_domain', $domain );
update_user_meta( $site_user->ID, 'primary_blog', $current_site->blog_id );

Expand Down

0 comments on commit 7a69d5b

Please sign in to comment.