From 8c1b5794e4bbdd6c453e5b84c6c5a3258061d37f Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Tue, 11 Jul 2023 12:57:19 +0000 Subject: [PATCH] I18n: Improve the use of `dashicons-external` icon for external links. This changeset modifies how the `dashicons-external` icon is used in external links by editing its styles and adding a space between the text and the icon for better accessibility. Props SergeyBiryukov, afercia, isabel_brison, mukesh27, sabernhardt, oglekler, audrasjb. Fixes #47303. git-svn-id: https://develop.svn.wordpress.org/trunk@56211 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/common.css | 5 +++++ src/wp-admin/includes/class-wp-site-health.php | 16 ++++++++-------- src/wp-admin/includes/dashboard.php | 12 ++++++------ src/wp-includes/functions.php | 2 +- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index a7b04fa37c..5907256d65 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -138,6 +138,11 @@ height: auto; /* Fixes a Safari+VoiceOver bug, see ticket #42006 */ } +.screen-reader-text + .dashicons-external { + margin-top: -1px; + margin-left: 2px; +} + .screen-reader-shortcut { position: absolute; top: -1000em; diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index fa2e06ac7d..a198b496d7 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -746,7 +746,7 @@ class WP_Site_Health { ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), /* translators: Hidden accessibility text. */ @@ -894,7 +894,7 @@ class WP_Site_Health { esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ), 'target="_blank" rel="noopener"', sprintf( - ' %s', + ' %s', /* translators: Hidden accessibility text. */ __( '(opens in a new tab)' ) ) @@ -1218,7 +1218,7 @@ class WP_Site_Health { __( 'The SQL server is a required piece of software for the database WordPress uses to store all your site’s content and settings.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', /* translators: Localized version of WordPress requirements if one exists. */ esc_url( __( 'https://wordpress.org/about/requirements/' ) ), __( 'Learn more about what WordPress requires to run.' ), @@ -1458,7 +1458,7 @@ class WP_Site_Health { ); $result['actions'] = sprintf( - '

%s %s

', + '

%s %s

', /* translators: Localized Support reference. */ esc_url( __( 'https://wordpress.org/support/forums/' ) ), __( 'Get help resolving this issue.' ), @@ -1496,7 +1496,7 @@ class WP_Site_Health { __( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', /* translators: Documentation explaining debugging in WordPress. */ esc_url( __( 'https://wordpress.org/documentation/article/debugging-in-wordpress/' ) ), __( 'Learn more about debugging in WordPress.' ), @@ -2478,7 +2478,7 @@ class WP_Site_Health { ); } else { $result['actions'] .= sprintf( - '

%s %s

', + '

%s %s

', __( 'https://developer.wordpress.org/rest-api/frequently-asked-questions/#why-is-authentication-not-working' ), __( 'Learn how to configure the Authorization header.' ), /* translators: Hidden accessibility text. */ @@ -2511,7 +2511,7 @@ class WP_Site_Health { 'status' => 'good', 'label' => '', 'actions' => sprintf( - '

%2$s %3$s

', + '

%2$s %3$s

', __( 'https://wordpress.org/documentation/article/optimization/#Caching' ), __( 'Learn more about page cache' ), /* translators: Hidden accessibility text. */ @@ -2637,7 +2637,7 @@ class WP_Site_Health { __( 'A persistent object cache makes your site’s database more efficient, resulting in faster load times because WordPress can retrieve your site’s content and settings much more quickly.' ) ), 'actions' => sprintf( - '

%s %s

', + '

%s %s

', esc_url( $action_url ), __( 'Learn more about persistent object caching.' ), /* translators: Hidden accessibility text. */ diff --git a/src/wp-admin/includes/dashboard.php b/src/wp-admin/includes/dashboard.php index c73ee8ee47..53a1043b17 100644 --- a/src/wp-admin/includes/dashboard.php +++ b/src/wp-admin/includes/dashboard.php @@ -1298,7 +1298,7 @@ function wp_dashboard_events_news() {

%2$s %3$s', + '%2$s %3$s', esc_url( wp_get_update_php_url() ), __( 'Learn more about updating PHP' ), /* translators: Hidden accessibility text. */ diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index 164548c680..adf8b86170 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -8239,7 +8239,7 @@ function wp_direct_php_update_button() { echo '

'; printf( - '%2$s %3$s', + '%2$s %3$s', esc_url( $direct_update_url ), __( 'Update PHP' ), /* translators: Hidden accessibility text. */