From 2c6df53917681401654f59f558e86650321e5cad Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 9 Sep 2020 16:13:17 +0000 Subject: [PATCH] Administration: Add the `aria-hidden` attribute to admin menu icons. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin menu icons are included as a visual element to support the text links. Without the `aria-hidden=“true”` attribute, they are also exposed to assistive technologies (which can process icon fonts in unpredictable ways). This change improves the experience for multiple types of assistive technologies, including screen reading and voice control software. With `aria-hidden=“true”` added, the icons will not be read, and a user can now trigger a click of a top level admin menu item with commands such as “click posts”, or “click plugins”. Props joedolson, afercia, audrasjb, adriantirusli. Fixes #51012. git-svn-id: https://develop.svn.wordpress.org/trunk@48963 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/menu-header.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/menu-header.php b/src/wp-admin/menu-header.php index 5bcffe2bd4..3e81e0bea7 100644 --- a/src/wp-admin/menu-header.php +++ b/src/wp-admin/menu-header.php @@ -165,9 +165,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; - echo "$arrow"; + echo "$arrow"; } else { - echo "\n\t$arrow"; + echo "\n\t$arrow"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); @@ -184,9 +184,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { $admin_is_parent = true; - echo "\n\t$arrow"; + echo "\n\t$arrow"; } else { - echo "\n\t$arrow"; + echo "\n\t$arrow"; } }