function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $element->main_count = count($children_elements[$element->menu_item_parent]);
     // check, whether there are children for the given ID and append it to the element with a (new) ID
     $element->hasChildren = isset($children_elements[$element->ID]) && !empty($children_elements[$element->ID]);
     return parent::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }
Ejemplo n.º 2
0
 function display_element($element, &$children_elements, $max_depth, $depth = 0, $args, &$output)
 {
     $id_field = $this->db_fields['id'];
     if (!empty($children_elements[$element->{$id_field}])) {
         $element->classes[] = 'arrow';
         //CSS classname here
         $element->title .= '<span class="caret right-caret">&raquo;</span>';
         //append html here
     }
     walker_nav_menu::display_element($element, $children_elements, $max_depth, $depth, $args, $output);
 }