Skip to content
This repository has been archived by the owner. It is now read-only.

Commit

Permalink
Fix nav walker infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
jmr06005 committed May 12, 2015
1 parent a89e915 commit 0e72f6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/nav-walker.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ function my_wp_nav_menu_objects_sub_menu( $sorted_menu_items, $args ) {
$level = 0;
$stack = array('0');
foreach($sorted_menu_items as $key => $menu_item) {
while($menu_item->menu_item_parent != array_pop($stack)) {
while(in_array($menu_item->menu_item_parent, $stack) && $menu_item->menu_item_parent != array_pop($stack)) {
$level--;
}
$level++;
Expand Down

0 comments on commit 0e72f6c

Please sign in to comment.