From 4ed6d8ad76728340da7f06628e0b37d5dab3ad23 Mon Sep 17 00:00:00 2001 From: joedolson Date: Fri, 16 Sep 2022 23:13:10 +0000 Subject: [PATCH] Login and Registration: Access improvements to network signup. Fix a variety of accessibility issues with the network registration and activation screens. Fix associations between error messages and fields, improve labels for radio buttons, add fieldset and legend to properly group fields. Props afercia, allisonplus, sabernhardt. Fixes #40361. Built from https://develop.svn.wordpress.org/trunk@54191 git-svn-id: http://core.svn.wordpress.org/trunk@53750 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-activate.php | 15 ++-- wp-includes/version.php | 2 +- wp-signup.php | 171 +++++++++++++++++++++++----------------- 3 files changed, 105 insertions(+), 83 deletions(-) diff --git a/wp-activate.php b/wp-activate.php index ff71779036..92b062eff0 100644 --- a/wp-activate.php +++ b/wp-activate.php @@ -105,10 +105,11 @@ add_action( 'wp_head', 'do_activate_header' ); function wpmu_activate_stylesheet() { ?> path . 'wp-activate.php' ); ?>">

-
+

@@ -213,9 +214,5 @@ $blog_details = get_blog_details(); ?> - ' . __( 'Site Domain:' ) . ''; } - $errmsg = $errors->get_error_message( 'blogname' ); - if ( $errmsg ) { - ?> -

- get_error_message( 'blogname' ); + $errmsg_blogname_aria = ''; + if ( $errmsg_blogname ) { + $errmsg_blogname_aria = 'wp-signup-blogname-error '; + echo '

' . $errmsg_blogname . '

'; } if ( ! is_subdomain_install() ) { - echo '' . $current_network->domain . $current_network->path . '
'; + echo '
' . $current_network->domain . $current_network->path . '
'; } else { $site_domain = preg_replace( '|^www\.|', '', $current_network->domain ); - echo '.' . esc_html( $site_domain ) . '
'; + echo '
.' . esc_html( $site_domain ) . '
'; } if ( ! is_user_logged_in() ) { @@ -143,13 +153,13 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { ?> get_error_message( 'blog_title' ); - if ( $errmsg ) { - ?> -

- get_error_message( 'blog_title' ); + $errmsg_blog_title_aria = ''; + if ( $errmsg_blog_title ) { + $errmsg_blog_title_aria = ' aria-describedby="wp-signup-blog-title-error"'; + echo '

' . $errmsg_blog_title . '

'; } - echo ''; + echo ''; ?>
-

- - -
- - -

+
+ + + + + +
' . __( 'Username:' ) . ''; - $errmsg = $errors->get_error_message( 'user_name' ); - if ( $errmsg ) { - echo '

' . $errmsg . '

'; + $errmsg_username = $errors->get_error_message( 'user_name' ); + $errmsg_username_aria = ''; + if ( $errmsg_username ) { + $errmsg_username_aria = 'wp-signup-username-error '; + echo '

' . $errmsg_username . '

'; } - echo '
'; - _e( '(Must be at least 4 characters, letters and numbers only.)' ); ?> + +

- get_error_message( 'user_email' ); - if ( $errmsg ) { - ?> -

- -
+ // Email address. + echo ''; + $errmsg_email = $errors->get_error_message( 'user_email' ); + $errmsg_email_aria = ''; + if ( $errmsg_email ) { + $errmsg_email_aria = 'wp-signup-email-error '; + echo '

' . $errmsg_email . '

'; + } + ?> + +

+ get_error_message( 'generic' ); - if ( $errmsg ) { - echo '

' . $errmsg . '

'; + // Extra fields. + $errmsg_generic = $errors->get_error_message( 'generic' ); + if ( $errmsg_generic ) { + echo '

' . $errmsg_generic . '

'; } /** * Fires at the end of the new user account registration form. @@ -609,19 +630,25 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) { ?> -

- + - + - - /> - -
- /> - - -

+ +
+ + +
+

@@ -841,19 +868,17 @@ function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $use

-

- -

-

+

+