From 6c9dfaede8dc65a8c8396ce0969a9103650297b0 Mon Sep 17 00:00:00 2001 From: joedolson Date: Fri, 30 Apr 2021 22:55:06 +0000 Subject: [PATCH] Toolbar: Remove title attribute on pending updates link. Remove the title attribute from the link, wrap the link icon and numeric indicator with the `aria-hidden` attribute, and add a `.screen-reader-text` span so screen readers hear a link that has relevant context without requiring translators to deal with appended strings. Removes the individual counts of theme and plugin updates from the attribute, as those were already buggy and didn't include translation counts. Props afercia, Mte90, sabernhardt, audrasjb Fixes #26562. See #53031. Built from https://develop.svn.wordpress.org/trunk@50801 git-svn-id: http://core.svn.wordpress.org/trunk@50410 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/admin-bar.php | 24 ++++++++++++++---------- wp-includes/version.php | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/wp-includes/admin-bar.php b/wp-includes/admin-bar.php index e6fba4b362..5d6d6fe98c 100644 --- a/wp-includes/admin-bar.php +++ b/wp-includes/admin-bar.php @@ -131,7 +131,7 @@ function wp_admin_bar_wp_menu( $wp_admin_bar ) { $wp_logo_menu_args = array( 'id' => 'wp-logo', - 'title' => '' . __( 'About WordPress' ) . '', + 'title' => '' . __( 'About WordPress' ) . '', 'href' => $about_url, ); @@ -209,7 +209,7 @@ function wp_admin_bar_sidebar_toggle( $wp_admin_bar ) { $wp_admin_bar->add_node( array( 'id' => 'menu-toggle', - 'title' => '' . __( 'Menu' ) . '', + 'title' => '' . __( 'Menu' ) . '', 'href' => '#', ) ); @@ -879,7 +879,7 @@ function wp_admin_bar_new_content_menu( $wp_admin_bar ) { return; } - $title = '' . _x( 'New', 'admin bar menu group label' ) . ''; + $title = '' . _x( 'New', 'admin bar menu group label' ) . ''; $wp_admin_bar->add_node( array( @@ -923,7 +923,7 @@ function wp_admin_bar_comments_menu( $wp_admin_bar ) { number_format_i18n( $awaiting_mod ) ); - $icon = ''; + $icon = ''; $title = ''; $title .= '' . $awaiting_text . ''; @@ -1033,17 +1033,21 @@ function wp_admin_bar_updates_menu( $wp_admin_bar ) { return; } - $title = '' . number_format_i18n( $update_data['counts']['total'] ) . ''; - $title .= '' . $update_data['title'] . ''; + $updates_text = sprintf( + /* translators: %s: Total number of updates available. */ + _n( '%s update available', '%s updates available', $update_data['counts']['total'] ), + number_format_i18n( $update_data['counts']['total'] ) + ); + + $icon = ''; + $title = ''; + $title .= '' . $updates_text . ''; $wp_admin_bar->add_node( array( 'id' => 'updates', - 'title' => $title, + 'title' => $icon . $title, 'href' => network_admin_url( 'update-core.php' ), - 'meta' => array( - 'title' => $update_data['title'], - ), ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index a24291165d..100a863c24 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50799'; +$wp_version = '5.8-alpha-50801'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.