WordPress.org

Make WordPress Core

Ticket #47436: 47436.2.patch

File 47436.2.patch, 684 bytes (added by viralsampat, 6 months ago)

Updated Patch.

  • src/wp-includes/nav-menu-template.php

     
    189189                }
    190190        }
    191191
    192         // Add the menu-item-has-children class where applicable
    193         if ( $menu_items_with_children ) {
     192        // Add the menu-item-has-children class where applicable and depth of the menu is not set to 1.
     193        if ( $menu_items_with_children && 1 != $args->depth ) {
    194194                foreach ( $sorted_menu_items as &$menu_item ) {
    195195                        if ( isset( $menu_items_with_children[ $menu_item->ID ] ) ) {
    196196                                $menu_item->classes[] = 'menu-item-has-children';