mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Remove nearly all tabindex attributes from the admin, leaving them only where absolutely necessary (for now that's only the toolbar).
Add tabindex="-1" for the menu images links to avoid double tab stops there when the menu is expanded. Fix/add auto-focus on the first input fields on the Add/Edit Post, all taxonomy, all edit taxonomy, Log In and Edit Comment screens. See #21340. git-svn-id: https://develop.svn.wordpress.org/trunk@21311 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -41,7 +41,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
foreach ( $menu as $key => $item ) {
|
||||
$admin_is_parent = false;
|
||||
$class = array();
|
||||
$aria_attributes = 'tabindex="1"';
|
||||
$aria_attributes = '';
|
||||
|
||||
if ( $first ) {
|
||||
$class[] = 'wp-first-item';
|
||||
@@ -59,7 +59,7 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
} else {
|
||||
$class[] = 'wp-not-current-submenu';
|
||||
if ( ! empty( $submenu_items ) )
|
||||
$aria_attributes .= ' aria-haspopup="true"';
|
||||
$aria_attributes .= 'aria-haspopup="true"';
|
||||
}
|
||||
|
||||
if ( ! empty( $item[4] ) )
|
||||
@@ -87,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 "<div class='wp-menu-image'><a href='admin.php?page={$submenu_items[0][2]}' aria-label='$aria_label'>$img</a></div>$arrow<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$title</a>";
|
||||
echo "<div class='wp-menu-image'><a href='admin.php?page={$submenu_items[0][2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$title</a>";
|
||||
} else {
|
||||
echo "\n\t<div class='wp-menu-image'><a href='{$submenu_items[0][2]}' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$submenu_items[0][2]}'$class $aria_attributes>$title</a>";
|
||||
echo "\n\t<div class='wp-menu-image'><a href='{$submenu_items[0][2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$submenu_items[0][2]}'$class $aria_attributes>$title</a>";
|
||||
}
|
||||
} elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
|
||||
$menu_hook = get_plugin_page_hook( $item[2], 'admin.php' );
|
||||
@@ -98,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<div class='wp-menu-image'><a href='admin.php?page={$item[2]}' aria-label='$aria_label'>$img</a></div>$arrow<a href='admin.php?page={$item[2]}'$class $aria_attributes>{$item[0]}</a>";
|
||||
echo "\n\t<div class='wp-menu-image'><a href='admin.php?page={$item[2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='admin.php?page={$item[2]}'$class $aria_attributes>{$item[0]}</a>";
|
||||
} else {
|
||||
echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$item[2]}'$class $aria_attributes>{$item[0]}</a>";
|
||||
echo "\n\t<div class='wp-menu-image'><a href='{$item[2]}' tabindex='-1' aria-label='$aria_label'>$img</a></div>$arrow<a href='{$item[2]}'$class $aria_attributes>{$item[0]}</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,6 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
if ( ! current_user_can( $sub_item[1] ) )
|
||||
continue;
|
||||
|
||||
$aria_attributes = 'tabindex="1"';
|
||||
$class = array();
|
||||
if ( $first ) {
|
||||
$class[] = 'wp-first-item';
|
||||
@@ -156,9 +155,9 @@ function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) {
|
||||
$sub_item_url = add_query_arg( array('page' => $sub_item[2]), 'admin.php' );
|
||||
|
||||
$sub_item_url = esc_url( $sub_item_url );
|
||||
echo "<li$class><a href='$sub_item_url'$class $aria_attributes>$title</a></li>";
|
||||
echo "<li$class><a href='$sub_item_url'$class>$title</a></li>";
|
||||
} else {
|
||||
echo "<li$class><a href='{$sub_item[2]}'$class $aria_attributes>$title</a></li>";
|
||||
echo "<li$class><a href='{$sub_item[2]}'$class>$title</a></li>";
|
||||
}
|
||||
}
|
||||
echo "</ul></div></div>";
|
||||
|
||||
Reference in New Issue
Block a user