From b4f856afbb7b6bc448a6b9ca8420c46e3c54db68 Mon Sep 17 00:00:00 2001 From: Simon Williams Date: Tue, 1 Jun 2021 14:38:26 +1000 Subject: [PATCH 1/2] returning false - replaced insert_blog with wp_insert_site --- includes/commands/class-mu-migration-import.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/commands/class-mu-migration-import.php b/includes/commands/class-mu-migration-import.php index 3f077fc..8b0bf8f 100644 --- a/includes/commands/class-mu-migration-import.php +++ b/includes/commands/class-mu-migration-import.php @@ -644,7 +644,22 @@ private function create_new_site( $meta_data ) { return false; } - $blog_id = insert_blog( $parsed_url['host'], $parsed_url['path'], $site_id ); + $now = current_time( 'mysql', true ); + $new_site_meta = array( + 'domain' => $parsed_url['host'], + 'path' => $parsed_url['path'], + 'network_id' => get_current_network_id(), + 'registered' => $now, + 'last_updated' => $now, + 'public' => 1, + 'archived' => 0, + 'mature' => 0, + 'spam' => 0, + 'deleted' => 0, + 'lang_id' => 0, + ); + + $blog_id = wp_insert_site( $new_site_meta ); if ( ! $blog_id ) { return false; From d14729bf323dfaa969d27dd7ed375fc39af9d094 Mon Sep 17 00:00:00 2001 From: Jeffrey Paul Date: Thu, 15 Feb 2024 14:58:08 -0600 Subject: [PATCH 2/2] Update includes/commands/class-mu-migration-import.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Nícholas André --- includes/commands/class-mu-migration-import.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/commands/class-mu-migration-import.php b/includes/commands/class-mu-migration-import.php index 8b0bf8f..1e61cf7 100644 --- a/includes/commands/class-mu-migration-import.php +++ b/includes/commands/class-mu-migration-import.php @@ -648,7 +648,7 @@ private function create_new_site( $meta_data ) { $new_site_meta = array( 'domain' => $parsed_url['host'], 'path' => $parsed_url['path'], - 'network_id' => get_current_network_id(), + 'network_id' => $site_id, 'registered' => $now, 'last_updated' => $now, 'public' => 1,