Skip to main content
2 of 2
corrected it so that a Notice wouldn't trigger if the variable wasn't set.

You could first check if $items[$count + 1] exists. Like

if( //check first if $items[$count + 1] exists, else it breaks here isset($items[ $count + 1 ] ) //now you know $item[$count + 1] exists, so you can continue && ( $items[$count + 1]->menu_item_parent != $parent_id && $submenu && $items[ $count + 1 ]->menu_item_parent != $item->ID ) ){ //something } 
Michel
  • 4.2k
  • 4
  • 39
  • 57