From 2ab769b1b9eb9bac40617fce5efcd140465dd927 Mon Sep 17 00:00:00 2001
From: Konstantin Obenland
diff --git a/src/wp-admin/js/user-profile.js b/src/wp-admin/js/user-profile.js
index d689d9a026..71ac46df4c 100644
--- a/src/wp-admin/js/user-profile.js
+++ b/src/wp-admin/js/user-profile.js
@@ -94,15 +94,13 @@
var show = pw_togglebtn.attr( 'data-toggle' );
if ( show == 1 ) {
pw_field.attr( 'type', 'text' );
- pw_togglebtn.attr( 'data-toggle', 0 )
- .find( '.text' )
- .text( userProfileL10n.hide )
+ pw_togglebtn.attr({ 'data-toggle': 0, 'aria-label': userProfileL10n.ariaHide })
+ .find( '.text' ).text( userProfileL10n.hide )
;
} else {
pw_field.attr( 'type', 'password' );
- pw_togglebtn.attr( 'data-toggle', 1 )
- .find( '.text' )
- .text( userProfileL10n.show )
+ pw_togglebtn.attr({ 'data-toggle': 1, 'aria-label': userProfileL10n.ariaShow })
+ .find( '.text' ).text( userProfileL10n.show )
;
}
pw_field.focus();
diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php
index 9eec86cb87..16ed1aab0c 100644
--- a/src/wp-admin/user-edit.php
+++ b/src/wp-admin/user-edit.php
@@ -464,12 +464,12 @@ if ( $show_password_fields ) :
diff --git a/src/wp-admin/user-new.php b/src/wp-admin/user-new.php
index da97a25184..55911ca252 100644
--- a/src/wp-admin/user-new.php
+++ b/src/wp-admin/user-new.php
@@ -402,12 +402,12 @@ if ( apply_filters( 'show_password_fields', true ) ) : ?>
diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
index 1fdb8993b3..370a4b8d2a 100644
--- a/src/wp-includes/script-loader.php
+++ b/src/wp-includes/script-loader.php
@@ -376,6 +376,8 @@ function wp_default_scripts( &$scripts ) {
did_action( 'init' ) && $scripts->localize( 'user-profile', 'userProfileL10n', array(
'show' => __( 'Show' ),
'hide' => __( 'Hide' ),
+ 'ariaShow' => esc_attr__( 'Show password' ),
+ 'ariaHide' => esc_attr__( 'Hide password' ),
) );
$scripts->add( 'language-chooser', "/wp-admin/js/language-chooser$suffix.js", array( 'jquery' ), false, 1 );
diff --git a/src/wp-login.php b/src/wp-login.php
index bbd787462d..8354e96928 100644
--- a/src/wp-login.php
+++ b/src/wp-login.php
@@ -655,8 +655,8 @@ case 'rp' :