'network_id' =>
get_current_network_id(),
'registered' =>
$now,
'last_updated' =>
$now,
'public' => 1,
'archived' => 0,
'mature' => 0,
'spam' => 0,
'deleted' => 0,
'lang_id' => 0,
);
$prepared_data =
wp_prepare_site_data( $data,
$defaults );
if ( is_wp_error( $prepared_data ) ) { return $prepared_data;
} if ( false ===
$wpdb->
insert( $wpdb->blogs,
$prepared_data ) ) { return new WP_Error( 'db_insert_error',
__( 'Could not insert site into the database.'
),
$wpdb->last_error
);
} $site_id =
(int) $wpdb->insert_id;
clean_blog_cache( $site_id );