From 388e7fe7f4ffa40fa5c18720e7f29c8a938d6281 Mon Sep 17 00:00:00 2001
From: Andrew Ozz
Date: Fri, 20 Sep 2019 18:50:19 +0000
Subject: [PATCH] Admin email verification: - Fix wording of the HTML title. -
Add hidden `(opens in a new tab)` to links that need it. - Add the
`screen-reader-text` CSS class to login.css. - Add another translator
comment.
Props afercia.
See #46349.
git-svn-id: https://develop.svn.wordpress.org/trunk@46203 602fd350-edb4-49c9-b593-d223f7449a82
---
src/wp-admin/css/login.css | 16 ++++++++++++++++
src/wp-login.php | 27 +++++++++++----------------
2 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/src/wp-admin/css/login.css b/src/wp-admin/css/login.css
index 12590f27f4..ff9060f7ed 100644
--- a/src/wp-admin/css/login.css
+++ b/src/wp-admin/css/login.css
@@ -328,6 +328,22 @@ body.interim-login {
margin: 0;
}
+/* Hide visually but not from screen readers */
+.screen-reader-text,
+.screen-reader-text span {
+ border: 0;
+ clip: rect(1px, 1px, 1px, 1px);
+ -webkit-clip-path: inset(50%);
+ clip-path: inset(50%);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
+}
+
@-ms-viewport {
width: device-width;
}
diff --git a/src/wp-login.php b/src/wp-login.php
index c57f0a26ce..c8693ee99f 100644
--- a/src/wp-login.php
+++ b/src/wp-login.php
@@ -606,7 +606,7 @@ switch ( $action ) {
exit;
}
- login_header( __( 'Confirm your admin email' ), '', $errors );
+ login_header( __( 'Confirm your administration email' ), '', $errors );
/**
* Fires before the admin email confirm form.
@@ -643,10 +643,14 @@ switch ( $action ) {
/* translators: URL to the WordPress help section about admin email. */
$admin_email_help_url = __( 'https://wordpress.org/support/article/settings-general-screen/#email-address' );
+ /* translators: accessibility text */
+ $accessibility_text = sprintf( ' %s', __( '(opens in a new tab)' ) );
+
printf(
- '%s',
+ '%s%s',
esc_url( $admin_email_help_url ),
- __( 'Why is this important?' )
+ __( 'Why is this important?' ),
+ $accessibility_text
);
?>
@@ -656,23 +660,14 @@ switch ( $action ) {
printf(
/* translators: %s: Admin email address. */
- __( 'Current administration email: %s' ),
- '' . esc_html( $admin_email ) . ''
+ __( 'Current administration email: %s' ),
+ esc_html( $admin_email )
);
?>
- %s',
- esc_url( $admin_email_help_url ),
- __( 'Learn more.' )
- );
-
- ?>
@@ -1248,13 +1243,13 @@ switch ( $action ) {
// to the admin email confirmation screen.
/** This filter is documented in wp-login.php */
$admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 180 * DAY_IN_SECONDS );
-
+$admin_email_lifespan = 5;
if ( $admin_email_check_interval > 0 && time() > $admin_email_lifespan ) {
$redirect_to = add_query_arg( 'action', 'confirm_admin_email', wp_login_url( $redirect_to ) );
}
}
- if ( ( empty( $redirect_to ) || $redirect_to === 'wp-admin/' || $redirect_to == admin_url() ) ) {
+ if ( ( empty( $redirect_to ) || $redirect_to === 'wp-admin/' || $redirect_to === admin_url() ) ) {
// If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile.
if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) {
$redirect_to = user_admin_url();