From: Laury GvR Date: Wed, 28 Mar 2018 16:07:47 +0000 (-0400) Subject: Show OC submenus - menu walker fix X-Git-Tag: v1.0.0^2~33 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=939bd6cf44f2181e4f4d70517ad59029cc1a4531;p=WP-Themes%2Fbayharbor.git 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. --- 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' : '';