lib/MenuItem.php
public function add_child( $item ) {
		if ( !$this->has_child_class ) {
			$this->add_class('menu-item-has-children');
			$this->has_child_class = true;
		}
		$this->children[] = $item;
		$item->level = $this->level + 1;
		if ( count($this->children) ) {
			$this->update_child_levels();
		}
	}
public function add_child( $item ) {
		if ( !$this->has_child_class ) {
			$this->add_class('menu-item-has-children');
			$this->has_child_class = true;
		}
		$this->children[] = $item;
		$item->level = $this->level + 1;
		if ( count($this->children) ) {
			$this->update_child_levels();
		}
	}
public function add_child ( $ item ) { if ( ! $ this -> has_child_class ) { $ this -> add_class ( 'menu-item-has-children' ) ; $ this -> has_child_class = true ; } $ this -> children [ ] = $ item ; $ item -> level = $ this -> level + 1 ; if ( count ( $ this -> children ) ) { $ this -> update_child_levels ( ) ; } }
Add a new `Timber\MenuItem` object as a child of this menu item.

@param \Timber\MenuItem $item The menu item to add.
Add a new Timber \ MenuItem object as a child of this menu item .