Skip to content

Commit

Permalink
Use ARIA label or remove title
Browse files Browse the repository at this point in the history
  • Loading branch information
sabernhardt committed Jan 21, 2025
1 parent 0bb851e commit 5ca727b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
19 changes: 8 additions & 11 deletions src/wp-admin/includes/class-wp-theme-install-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ public function single_row( $theme ) {
switch ( $status ) {
case 'update_available':
$actions[] = sprintf(
'<a class="install-now" href="%s" title="%s">%s</a>',
'<a class="install-now" href="%s" aria-label="%s">%s</a>',
esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
/* translators: %s: Theme version. */
esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
Expand All @@ -325,15 +325,14 @@ public function single_row( $theme ) {
case 'newer_installed':
case 'latest_installed':
$actions[] = sprintf(
'<span class="install-now" title="%s">%s</span>',
esc_attr__( 'This theme is already installed and is up to date' ),
'<span class="install-now">%s</span>',
_x( 'Installed', 'theme' )
);
break;
case 'install':
default:
$actions[] = sprintf(
'<a class="install-now" href="%s" title="%s">%s</a>',
'<a class="install-now" href="%s" aria-label="%s">%s</a>',
esc_url( wp_nonce_url( $install_url, 'install-theme_' . $theme->slug ) ),
/* translators: %s: Theme name. */
esc_attr( sprintf( _x( 'Install %s', 'theme' ), $name ) ),
Expand All @@ -343,10 +342,9 @@ public function single_row( $theme ) {
}

$actions[] = sprintf(
'<a class="install-theme-preview" href="%s" title="%s">%s</a>',
'<a class="install-theme-preview" href="%s" aria-label="%s">%s</a>',
esc_url( $preview_url ),
/* translators: %s: Theme name. */
esc_attr( sprintf( __( 'Preview %s' ), $name ) ),
esc_attr( $preview_title ),
__( 'Preview' )
);

Expand All @@ -363,7 +361,7 @@ public function single_row( $theme ) {
$actions = apply_filters( 'theme_install_actions', $actions, $theme );

?>
<a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" title="<?php echo esc_attr( $preview_title ); ?>">
<a class="screenshot install-theme-preview" href="<?php echo esc_url( $preview_url ); ?>" aria-label="<?php echo esc_attr( $preview_title ); ?>">
<img src="<?php echo esc_url( $theme->screenshot_url . '?ver=' . $theme->version ); ?>" width="150" alt="" />
</a>

Expand Down Expand Up @@ -474,7 +472,7 @@ public function install_theme_info( $theme ) {
switch ( $status ) {
case 'update_available':
printf(
'<a class="theme-install button button-primary" href="%s" title="%s">%s</a>',
'<a class="theme-install button button-primary" href="%s" aria-label="%s">%s</a>',
esc_url( wp_nonce_url( $update_url, 'upgrade-theme_' . $theme->slug ) ),
/* translators: %s: Theme version. */
esc_attr( sprintf( __( 'Update to version %s' ), $theme->version ) ),
Expand All @@ -484,8 +482,7 @@ public function install_theme_info( $theme ) {
case 'newer_installed':
case 'latest_installed':
printf(
'<span class="theme-install" title="%s">%s</span>',
esc_attr__( 'This theme is already installed and is up to date' ),
'<span class="theme-install">%s</span>',
_x( 'Installed', 'theme' )
);
break;
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-wp-themes-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function display_rows() {

$actions = array();
$actions['activate'] = sprintf(
'<a href="%s" class="activatelink" title="%s">%s</a>',
'<a href="%s" class="activatelink" aria-label="%s">%s</a>',
$activate_link,
/* translators: %s: Theme name. */
esc_attr( sprintf( _x( 'Activate &#8220;%s&#8221;', 'theme' ), $title ) ),
Expand Down

0 comments on commit 5ca727b

Please sign in to comment.