- wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
- confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta);
+ $blog_meta_defaults = array(
+ 'lang_id' => 1,
+ 'public' => $public
+ );
+
+ // Handle the language setting for the new site.
+ if ( ! empty( $_POST['WPLANG'] ) ) {
+
+ $languages = signup_get_available_languages();
+
+ if ( in_array( $_POST['WPLANG'], $languages ) ) {
+ $language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) );
+
+ if ( $language ) {
+ $blog_meta_defaults['WPLANG'] = $language;
+ }
+ }
+
+ }
+
+ /**
+ * Filters the new site meta variables.
+ *
+ * Use the {@see 'add_signup_meta'} filter instead.
+ *
+ * @since MU
+ * @deprecated 3.0.0 Use the {@see 'add_signup_meta'} filter instead.
+ *
+ * @param array $blog_meta_defaults An array of default blog meta variables.
+ */
+ $meta_defaults = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults );
+
+ /**
+ * Filters the new default site meta variables.
+ *
+ * @since 3.0.0
+ *
+ * @param array $meta {
+ * An array of default site meta variables.
+ *
+ * @type int $lang_id The language ID.
+ * @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false.
+ * }
+ */
+ $meta = apply_filters( 'add_signup_meta', $meta_defaults );
+
+ $blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid );
+
+ if ( is_wp_error( $blog_id ) ) {
+ return false;
+ }
+
+ confirm_another_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id );