diff --git a/wp-activate.php b/wp-activate.php index 0fb0eaecf8..f9caa982aa 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -115,8 +115,12 @@ get_header();
- -
View your site or Log in'), $url, $url . 'wp-login.php' ); ?>
+ +View your site or Log in' ), $url, esc_url( $login_url ) ); ?>
Log in or go back to the homepage.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?>
ID, $meta, $wpdb->siteid ); - confirm_another_blog_signup($domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta); + $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 ); return true; } @@ -362,19 +367,43 @@ function validate_another_blog_signup() { * Confirm a new site signup * * @since MU + * @since 4.4.0 Added the `$blog_id` parameter. * * @param string $domain The domain URL * @param string $path The site root path * @param string $blog_title The blog title * @param string $user_name The username * @param string $user_email The user's email address - * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() + * @param array $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() + * @param int $blog_id The blog ID */ -function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array() ) { +function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) { + + if ( $blog_id ) { + switch_to_blog( $blog_id ); + $home_url = home_url( '/' ); + $login_url = wp_login_url(); + restore_current_blog(); + } else { + $home_url = 'http://' . $domain . $path; + $login_url = 'http://' . $domain . $path . 'wp-login.php'; + } + + $site = sprintf( '%2$s', + esc_url( $home_url ), + $blog_title + ); + ?> -- http://%2$s is your new site. Log in as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?> + %2$s is your new site. Log in as “%4$s” using your existing password.' ), + esc_url( $home_url ), + untrailingslashit( $domain . $path ), + esc_url( $login_url ), + $user_name + ); ?>