From 939bd6cf44f2181e4f4d70517ad59029cc1a4531 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Wed, 28 Mar 2018 12:07:47 -0400 Subject: [PATCH] Show OC submenus - menu walker fix 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/menu-walker.php b/lib/menu-walker.php index fafabde..18b944c 100644 --- a/lib/menu-walker.php +++ b/lib/menu-walker.php @@ -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' : ''; -- 2.17.1