core/NavbarWalker.php
public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
    {
        if (!$element) {
            return;
        }

        $id_field = $this->db_fields['id'];

        if (is_object($args[0])) {
           $args[0]->has_children = !empty($children_elements[$element->$id_field]);
        }

        return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
    }
public function display_element($element, &$children_elements, $max_depth, $depth, $args, &$output)
    {
        if (!$element) {
            return;
        }

        $id_field = $this->db_fields['id'];

        if (is_object($args[0])) {
           $args[0]->has_children = !empty($children_elements[$element->$id_field]);
        }

        return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
    }
public function display_element ( $ element , & $ children_elements , $ max_depth , $ depth , $ args , & $ output ) { if ( ! $ element ) { return ; } $ id_field = $ this -> db_fields [ 'id' ] ; if ( is_object ( $ args [ 0 ] ) ) { $ args [ 0 ] -> has_children = ! empty ( $ children_elements [ $ element -> $ id_field ] ) ; } return parent :: display_element ( $ element , $ children_elements , $ max_depth , $ depth , $ args , $ output ) ; }
Traverse elements to create list from elements

Display one element if the element doesn't have any children otherwise,
display the element and its children. Will only traverse up to the max
depth and no ignore elements under that depth.

This method shouldn't be called directly, use the walk() method instead.

@param object  $element           Data object.
@param array   $children_elements List of elements to continue traversing.
@param integer $max_depth         Max depth to traverse.
@param integer $depth             Depth of current element.
@param array   $args              An array of arguments.
@param string  $output            Passed by reference. Used to append additional content.

@return null
Traverse elements to create list from elements