Login and Registration: Required fields in network registration.
Properly label site and user information on the network registration screen with the HTML5 required attribute and clarify the values expected for the site domain and subdirectory fields. Props SteelWagstaff, henrywright, sabernhardt. Fixes #54344. Built from https://develop.svn.wordpress.org/trunk@54192 git-svn-id: http://core.svn.wordpress.org/trunk@53751 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4ed6d8ad76
commit
b67e8e4dd9
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-54191';
|
$wp_version = '6.1-alpha-54192';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
|
@ -115,9 +115,9 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
|
||||||
$current_network = get_network();
|
$current_network = get_network();
|
||||||
// Blog name.
|
// Blog name.
|
||||||
if ( ! is_subdomain_install() ) {
|
if ( ! is_subdomain_install() ) {
|
||||||
echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>';
|
echo '<label for="blogname">' . __( 'Site Name (subdirectory only):' ) . '</label>';
|
||||||
} else {
|
} else {
|
||||||
echo '<label for="blogname">' . __( 'Site Domain:' ) . '</label>';
|
echo '<label for="blogname">' . __( 'Site Domain (subdomain only):' ) . '</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$errmsg_blogname = $errors->get_error_message( 'blogname' );
|
$errmsg_blogname = $errors->get_error_message( 'blogname' );
|
||||||
|
@ -128,10 +128,10 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! is_subdomain_install() ) {
|
if ( ! is_subdomain_install() ) {
|
||||||
echo '<div class="wp-signup-blogname"><span class="prefix_address" id="prefix-address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" aria-describedby="' . $errmsg_blogname_aria . 'prefix-address" /></div>';
|
echo '<div class="wp-signup-blogname"><span class="prefix_address" id="prefix-address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'prefix-address" /></div>';
|
||||||
} else {
|
} else {
|
||||||
$site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
|
$site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
|
||||||
echo '<div class="wp-signup-blogname"><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" aria-describedby="' . $errmsg_blogname_aria . 'suffix-address" /><span class="suffix_address" id="suffix-address">.' . esc_html( $site_domain ) . '</span></div>';
|
echo '<div class="wp-signup-blogname"><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'suffix-address" /><span class="suffix_address" id="suffix-address">.' . esc_html( $site_domain ) . '</span></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! is_user_logged_in() ) {
|
if ( ! is_user_logged_in() ) {
|
||||||
|
@ -159,7 +159,7 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
|
||||||
$errmsg_blog_title_aria = ' aria-describedby="wp-signup-blog-title-error"';
|
$errmsg_blog_title_aria = ' aria-describedby="wp-signup-blog-title-error"';
|
||||||
echo '<p class="error" id="wp-signup-blog-title-error">' . $errmsg_blog_title . '</p>';
|
echo '<p class="error" id="wp-signup-blog-title-error">' . $errmsg_blog_title . '</p>';
|
||||||
}
|
}
|
||||||
echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" autocomplete="off"' . $errmsg_blog_title_aria . ' />';
|
echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" required="required" autocomplete="off"' . $errmsg_blog_title_aria . ' />';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -276,7 +276,7 @@ function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
|
||||||
echo '<p class="error" id="wp-signup-username-error">' . $errmsg_username . '</p>';
|
echo '<p class="error" id="wp-signup-username-error">' . $errmsg_username . '</p>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<input name="user_name" type="text" id="user_name" value="<?php echo esc_attr( $user_name ); ?>" autocapitalize="none" autocorrect="off" maxlength="60" autocomplete="username" aria-describedby="<?php echo $errmsg_username_aria; ?>wp-signup-username-description" />
|
<input name="user_name" type="text" id="user_name" value="<?php echo esc_attr( $user_name ); ?>" autocapitalize="none" autocorrect="off" maxlength="60" autocomplete="username" required="required" aria-describedby="<?php echo $errmsg_username_aria; ?>wp-signup-username-description" />
|
||||||
<p id="wp-signup-username-description"><?php _e( '(Must be at least 4 characters, lowercase letters and numbers only.)' ); ?></p>
|
<p id="wp-signup-username-description"><?php _e( '(Must be at least 4 characters, lowercase letters and numbers only.)' ); ?></p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
@ -289,7 +289,7 @@ function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
|
||||||
echo '<p class="error" id="wp-signup-email-error">' . $errmsg_email . '</p>';
|
echo '<p class="error" id="wp-signup-email-error">' . $errmsg_email . '</p>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" autocomplete="email" aria-describedby="<?php echo $errmsg_email_aria; ?>wp-signup-email-description" />
|
<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" autocomplete="email" required="required" aria-describedby="<?php echo $errmsg_email_aria; ?>wp-signup-email-description" />
|
||||||
<p id="wp-signup-email-description"><?php _e( 'Your registration email is sent to this address. (Double-check your email address before continuing.)' ); ?></p>
|
<p id="wp-signup-email-description"><?php _e( 'Your registration email is sent to this address. (Double-check your email address before continuing.)' ); ?></p>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
Loading…
Reference in New Issue