public function remove_child(custom_menu_item $menuitem) {
        $removed = false;
        if (($key = array_search($menuitem, $this->children)) !== false) {
            unset($this->children[$key]);
            $this->children = array_values($this->children);
            $removed = true;
        } else {
            foreach ($this->children as $child) {
                if ($removed = $child->remove_child($menuitem)) {
                    break;
                }
            }
        }
        return $removed;
    }
public function remove_child(custom_menu_item $menuitem) {
        $removed = false;
        if (($key = array_search($menuitem, $this->children)) !== false) {
            unset($this->children[$key]);
            $this->children = array_values($this->children);
            $removed = true;
        } else {
            foreach ($this->children as $child) {
                if ($removed = $child->remove_child($menuitem)) {
                    break;
                }
            }
        }
        return $removed;
    }
public function remove_child ( custom_menu_item $ menuitem ) { $ removed = false ; if ( ( $ key = array_search ( $ menuitem , $ this -> children ) ) !== false ) { unset ( $ this -> children [ $ key ] ) ; $ this -> children = array_values ( $ this -> children ) ; $ removed = true ; } else { foreach ( $ this -> children as $ child ) { if ( $ removed = $ child -> remove_child ( $ menuitem ) ) { break ; } } } return $ removed ; }
Removes a custom menu item that is a child or descendant to the current menu.

Returns true if child was found and removed.

@param custom_menu_item $menuitem
@return bool
Removes a custom menu item that is a child or descendant to the current menu .