From ac690426ebc24d3d986d8905c23d7174cbad57c0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 9 Dec 2019 13:49:03 +0000 Subject: [PATCH] Accessibility: Menus: Properly disable form controls on the Menus screen that cannot be used until at least one menu is created. This ensures that the actual UI controls state matches the visually conveyed state. Props afercia, audrasjb, dinhtungdu, sathyapulse, simonjanin, welcher, SergeyBiryukov. Fixes #48409. Built from https://develop.svn.wordpress.org/trunk@46842 git-svn-id: http://core.svn.wordpress.org/trunk@46642 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../class-walker-nav-menu-checklist.php | 7 +++--- wp-admin/includes/nav-menu.php | 22 ++++++++++--------- wp-includes/version.php | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/wp-admin/includes/class-walker-nav-menu-checklist.php b/wp-admin/includes/class-walker-nav-menu-checklist.php index 81c088420c..6cacf1874a 100644 --- a/wp-admin/includes/class-walker-nav-menu-checklist.php +++ b/wp-admin/includes/class-walker-nav-menu-checklist.php @@ -62,7 +62,8 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * * @since 3.0.0 * - * @global int $_nav_menu_placeholder + * @global int $_nav_menu_placeholder + * @global int|string $nav_menu_selected_id * * @param string $output Used to append additional content (passed by reference). * @param object $item Menu item data object. @@ -71,7 +72,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { * @param int $id Not used. */ public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { - global $_nav_menu_placeholder; + global $_nav_menu_placeholder, $nav_menu_selected_id; $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1; $possible_object_id = isset( $item->post_type ) && 'nav_menu_item' == $item->post_type ? $item->object_id : $_nav_menu_placeholder; @@ -81,7 +82,7 @@ class Walker_Nav_Menu_Checklist extends Walker_Nav_Menu { $output .= $indent . '
  • '; $output .= '