Remove unnecessary initial_parent parameter in top bar walker
authorLaury GvR <laury@gaslightmedia.com>
Fri, 6 Apr 2018 15:25:31 +0000 (11:25 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Fri, 6 Apr 2018 15:25:31 +0000 (11:25 -0400)
lib/menu-walker.php

index 18b944c..f50c707 100644 (file)
@@ -4,7 +4,7 @@
  */
 if ( ! class_exists( 'Glm_Theme_Top_Bar_Walker' ) ) :
 class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
-    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output, $initial_parent ) {
+    function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
         static $mainLevelCounter;
         if ($depth == 0) {
             ++$mainLevelCounter;
@@ -13,7 +13,7 @@ class Glm_Theme_Top_Bar_Walker extends Walker_Nav_Menu {
         $element->classes[] = ( $element->current || $element->current_item_ancestor ) ? 'active' : '';
         $element->classes[] = ( $element->has_children && 1 !== $max_depth ) ? 'has-dropdown' : '';
         $element->classes[] = ( count($children_elements[$element->ID]) > 4 ) ? 'submenu-two-columns' : '';
-        $element->classes[] = ( $element->post_parent == $initial_parent && $mainLevelCounter < 4 ) ? 'drop-right '.$initial_parent.'-also-'.$element->post_parent : 'drop-left '.$initial_parent.'-also-'.$element->post_parent;
+        $element->classes[] = ( $mainLevelCounter < 4 ) ? 'drop-right' : 'drop-left';
         parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
     }