From 37e27441059b16191d41e1fb7a848beae0317eed Mon Sep 17 00:00:00 2001 From: audrasjb Date: Tue, 21 Jan 2025 21:49:22 +0000 Subject: [PATCH] Themes: Remove title attributes from theme list tables. This changeset updates the old list tables for themes and theme installation to remove `title` attributes or replace them with a more acessible implementation: - Removes `title` attributes from `span` elements - Replaces `title` with `aria-label` for links whose visible text starts with the same word, consistently with links on the "Add Plugins" screen - Reuses the `$preview_title` variable to keep ARIA labels consistent for both Preview links Follow-up to [22439], [27548], [31513], [32991], [50804], [53414]. Props karlgroves, sabernhardt, audrasjb, alh0319. Fixes #62834. See #24766. Built from https://develop.svn.wordpress.org/trunk@59675 git-svn-id: http://core.svn.wordpress.org/trunk@59018 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-wp-theme-install-list-table.php | 19 ++++++++----------- .../includes/class-wp-themes-list-table.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/wp-admin/includes/class-wp-theme-install-list-table.php b/wp-admin/includes/class-wp-theme-install-list-table.php index bf2d2fb34d..7e00005ba4 100644 --- a/wp-admin/includes/class-wp-theme-install-list-table.php +++ b/wp-admin/includes/class-wp-theme-install-list-table.php @@ -315,7 +315,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { switch ( $status ) { case 'update_available': $actions[] = sprintf( - '%s', + '%s', esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ), /* translators: %s: Theme version. */ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ), @@ -325,15 +325,14 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { case 'newer_installed': case 'latest_installed': $actions[] = sprintf( - '%s', - esc_attr__( 'This theme is already installed and is up to date' ), + '%s', _x( 'Installed', 'theme' ) ); break; case 'install': default: $actions[] = sprintf( - '%s', + '%s', esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ), /* translators: %s: Theme name. */ esc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ), @@ -343,10 +342,9 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { } $actions[] = sprintf( - '%s', + '%s', esc_url( $preview_url ), - /* translators: %s: Theme name. */ - esc_attr( sprintf( __( 'Preview %s' ), $name ) ), + esc_attr( $preview_title ), __( 'Preview' ) ); @@ -363,7 +361,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { $actions = apply_filters( 'theme_install_actions', $actions, $theme ); ?> - + @@ -474,7 +472,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { switch ( $status ) { case 'update_available': printf( - '%s', + '%s', esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ), /* translators: %s: Theme version. */ esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ), @@ -484,8 +482,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table { case 'newer_installed': case 'latest_installed': printf( - '%s', - esc_attr__( 'This theme is already installed and is up to date' ), + '%s', _x( 'Installed', 'theme' ) ); break; diff --git a/wp-admin/includes/class-wp-themes-list-table.php b/wp-admin/includes/class-wp-themes-list-table.php index 53b34e93f9..b17fb912d2 100644 --- a/wp-admin/includes/class-wp-themes-list-table.php +++ b/wp-admin/includes/class-wp-themes-list-table.php @@ -211,7 +211,7 @@ class WP_Themes_List_Table extends WP_List_Table { $actions = array(); $actions['activate'] = sprintf( - '%s', + '%s', $activate_link, /* translators: %s: Theme name. */ esc_attr( sprintf( _x( 'Activate “%s”', 'theme' ), $title ) ), diff --git a/wp-includes/version.php b/wp-includes/version.php index 9c1cd69092..0a3a0cbc35 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8-alpha-59674'; +$wp_version = '6.8-alpha-59675'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.