WordPress.org

Make WordPress Core

Ticket #28620: 28620.2.diff

File 28620.2.diff, 680 bytes (added by mdgl, 5 years ago)
  • wp-includes/class-walker-nav-menu.php

     
    9090                $classes = empty( $item->classes ) ? array() : (array) $item->classes;
    9191                $classes[] = 'menu-item-' . $item->ID;
    9292
     93                if ( ( -1 === $args->depth ) || ( $args->depth > 0 && ( ( $depth + 1 ) === $args->depth ) ) ) {
     94                        $_classes = array_fill_keys( $classes, '' );
     95                        unset( $_classes['menu-item-has-children'] );
     96                        $classes = array_keys( $_classes );
     97                }
     98
    9399                /**
    94100                 * Filters the arguments for a single nav menu item.
    95101                 *