X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..607b7e02d77e7326161e8ec15639052d2040f745:/wp-signup.php
diff --git a/wp-signup.php b/wp-signup.php
index bd46d02c..99bd2afb 100644
--- a/wp-signup.php
+++ b/wp-signup.php
@@ -91,11 +91,15 @@ do_action( 'before_signup_form' );
*
* @since MU
*
- * @param string $blogname The new site name
- * @param string $blog_title The new site title
- * @param array $errors
+ * @param string $blogname The new site name.
+ * @param string $blog_title The new site title.
+ * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string.
*/
function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
+ if ( ! is_wp_error( $errors ) ) {
+ $errors = new WP_Error();
+ }
+
$current_site = get_current_site();
// Blog name
if ( !is_subdomain_install() )
@@ -112,12 +116,15 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
else
echo '.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_site->domain ) ) . '
';
- if ( !is_user_logged_in() ) {
- if ( !is_subdomain_install() )
+ if ( ! is_user_logged_in() ) {
+ if ( ! is_subdomain_install() ) {
$site = $current_site->domain . $current_site->path . __( 'sitename' );
- else
+ } else {
$site = __( 'domain' ) . '.' . $site_domain . $current_site->path;
- echo '
(' . sprintf( __('Your address will be %s.'), $site ) . ') ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '
'; + } + + /* translators: %s: site address */ + echo '(' . sprintf( __( 'Your address will be %s.' ), $site ) . ') ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '
'; } // Blog Title @@ -183,7 +190,7 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { * * @since 3.0.0 * - * @param array $errors An array possibly containing 'blogname' or 'blog_title' errors. + * @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors. */ do_action( 'signup_blogform', $errors ); } @@ -208,17 +215,21 @@ function validate_blog_form() { * * @since MU * - * @param string $user_name The entered username - * @param string $user_email The entered email address - * @param array $errors + * @param string $user_name The entered username. + * @param string $user_email The entered email address. + * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. */ function show_user_form($user_name = '', $user_email = '', $errors = '') { + if ( ! is_wp_error( $errors ) ) { + $errors = new WP_Error(); + } + // User name echo ''; if ( $errmsg = $errors->get_error_message('user_name') ) { echo ''.$errmsg.'
'; } - echo '%2$s is your new site. Log in as “%4$s” using your existing password.' ), esc_url( $home_url ), untrailingslashit( $domain . $path ), @@ -475,9 +492,9 @@ function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $ * * @since MU * - * @param string $user_name The username - * @param string $user_email The user's email - * @param array $errors + * @param string $user_name The username. + * @param string $user_email The user's email. + * @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. */ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { global $active_signup; @@ -494,16 +511,16 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { ); /** - * Filter the default user variables used on the user sign-up form. + * Filters the default user variables used on the user sign-up form. * * @since 3.0.0 * * @param array $signup_user_defaults { * An array of default user variables. * - * @type string $user_name The user username. - * @type string $user_email The user email address. - * @type array $errors An array of possible errors relevant to the sign-up user. + * @type string $user_name The user username. + * @type string $user_email The user email address. + * @type WP_Error $errors A WP_Error object with possible errors relevant to the sign-up user. * } */ $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults ); @@ -513,7 +530,10 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { ?> -