Show OC submenus - menu walker fix
authorLaury GvR <laury@gaslightmedia.com>
Wed, 28 Mar 2018 16:07:47 +0000 (12:07 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 28 Mar 2018 16:07:47 +0000 (12:07 -0400)
The menu walker for off-canvas menus was checking for whether the
element was the hotel page ID and if so removing all the child
elements for the entire navigation object - it was instead meant
to remove only those which were children of the Hotel Page. This
is now fixed.

lib/menu-walker.php

index fafabde..18b944c 100644 (file)
@@ -94,7 +94,7 @@ if ( ! class_exists( 'Glm_Theme_Off_Canvas_Walker' ) ) :
 class Glm_Theme_Off_Canvas_Walker extends Walker_Nav_Menu {
     function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
         if ( HOTEL_PAGE_ID == $element->object_id ) {
-            $children_elements = null;
+            $children_elements[ $element->ID ] = null;
         }
         $element->has_children = ! empty( $children_elements[ $element->ID ] );
         $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';