From 46839c23eb50251977b86286cd0a5a1e186a3af5 Mon Sep 17 00:00:00 2001 From: azaozz Date: Wed, 2 May 2012 01:41:15 +0000 Subject: [PATCH] Admin menu: add aria-label attributes to the links around menu images for the sake of screen readers, fixes #20373 git-svn-id: http://core.svn.wordpress.org/trunk@20680 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/menu-header.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/menu-header.php b/wp-admin/menu-header.php index cdd81b2ad..72639ec2e 100644 --- a/wp-admin/menu-header.php +++ b/wp-admin/menu-header.php @@ -73,6 +73,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { $arrow = ''; $title = wptexturize( $item[0] ); + $aria_label = esc_attr( wp_strip_all_tags( $item[0], true ) ); // strip the comment/plugins/updates bubbles spans but keep the pending number if any echo "\n\t"; @@ -86,9 +87,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { $menu_file = substr( $menu_file, 0, $pos ); if ( ! empty( $menu_hook ) || ( ('index.php' != $submenu_items[0][2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) { $admin_is_parent = true; - echo "$arrow$title"; + echo "$arrow$title"; } else { - echo "\n\t$arrow$title"; + echo "\n\t$arrow$title"; } } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); @@ -97,9 +98,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { $menu_file = substr( $menu_file, 0, $pos ); if ( ! empty( $menu_hook ) || ( ('index.php' != $item[2]) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) ) ) { $admin_is_parent = true; - echo "\n\t$arrow{$item[0]}"; + echo "\n\t$arrow{$item[0]}"; } else { - echo "\n\t$arrow{$item[0]}"; + echo "\n\t$arrow{$item[0]}"; } }