WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/09/2019 01:48:37 PM (23 months ago)
Author:
SergeyBiryukov
Message:

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.
Merges [46842] to the 5.3 branch.
Fixes #48409.

Location:
branches/5.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.3

  • branches/5.3/src/wp-admin/includes/class-walker-nav-menu-checklist.php

    r46380 r46843  
    6363     * @since 3.0.0
    6464     *
    65      * @global int $_nav_menu_placeholder
     65     * @global int        $_nav_menu_placeholder
     66     * @global int|string $nav_menu_selected_id
    6667     *
    6768     * @param string $output Used to append additional content (passed by reference).
     
    7273     */
    7374    public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
    74         global $_nav_menu_placeholder;
     75        global $_nav_menu_placeholder, $nav_menu_selected_id;
    7576
    7677        $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval( $_nav_menu_placeholder ) - 1 : -1;
     
    8283        $output .= $indent . '<li>';
    8384        $output .= '<label class="menu-item-title">';
    84         $output .= '<input type="checkbox" class="menu-item-checkbox';
     85        $output .= '<input type="checkbox"' . wp_nav_menu_disabled_check( $nav_menu_selected_id, false ) . ' class="menu-item-checkbox';
    8586
    8687        if ( ! empty( $item->front_or_home ) ) {
Note: See TracChangeset for help on using the changeset viewer.