From ce168ea06b3589c323428975b9ae269c9e27f7a0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 10 Sep 2021 14:47:24 +0000 Subject: [PATCH] Accessibility: Administration: Improve `aria-label` on network admin Themes screen. This ensures that the beginning of the label matches the visible link text. Add a similar label for the plugin URI link on the Plugins screen when the plugin is outside of the directory. Follow-up to [28673], [28706], [35924]. Props sabernhardt, zeo, audrasjb. Fixes #24442. git-svn-id: https://develop.svn.wordpress.org/trunk@51795 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-ms-themes-list-table.php | 2 +- src/wp-admin/includes/class-wp-plugins-list-table.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/class-wp-ms-themes-list-table.php b/src/wp-admin/includes/class-wp-ms-themes-list-table.php index dd6b6d6c17..e87da5ca7a 100644 --- a/src/wp-admin/includes/class-wp-ms-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-ms-themes-list-table.php @@ -721,7 +721,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table { if ( $theme->get( 'ThemeURI' ) ) { /* translators: %s: Theme name. */ - $aria_label = sprintf( __( 'Visit %s homepage' ), $theme->display( 'Name' ) ); + $aria_label = sprintf( __( 'Visit theme site for %s' ), $theme->display( 'Name' ) ); $theme_meta[] = sprintf( '%s', diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index a5831dad17..32af4ad8ae 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -1066,9 +1066,13 @@ class WP_Plugins_List_Table extends WP_List_Table { __( 'View details' ) ); } elseif ( ! empty( $plugin_data['PluginURI'] ) ) { + /* translators: %s: Plugin name. */ + $aria_label = sprintf( __( 'Visit plugin site for %s' ), $plugin_name ); + $plugin_meta[] = sprintf( - '%s', + '%s', esc_url( $plugin_data['PluginURI'] ), + esc_attr( $aria_label ), __( 'Visit plugin site' ) ); }