Add menu item in hook form submit I have an entity, when i submit this entity i want to add the new entity created in a menu as a link. But in this menu i have a tree links so i don't know how to put my link in a specific tree. I saw the "mlid" and the "plid", i think "mlid" is the id of the menu and the "plid" is the id of the mother link.

So if I want to add a new item, what do I need to do? Do I get the ID of the parent link? 
Do I need to use menu_link_save()? How do I construct my new link?

This is the code I am using.

$menu_intervenant_loaded = menu_load_links('menu-intervenant-project'. $idProject);

foreach ($menu_intervenant_loaded as $menu_item) {
  $menutitle = str_replace(" ","+", $menu_item['link_title']);
  $mlid = $menu_item['mlid'];
  $link = menu_link_load($mlid);
  $haschildren = $menu_item['has_children'];
  if ($menutitle == "Entreprises") {
    //The parent link: here is where I need to create my link.
    $item = array(
        'title' =&gt; 'Montitre',
        'access' =&gt; TRUE,
        'link_path' =&gt; 'encore un test',
        'link_title' =&gt; 'Mon titre qui fonctionne pas',
        'plid' =&gt; $mlid,
        'customized' =&gt; 1,
        'external' =&gt; 1,
    );

    menu_link_save($item);
  }
}


EDIT : With this code the link appear when i debug my menu before submit, but doesn't appear in my administration and front-end where the menu is placed..
Value of plid is the menu link id of the item you want your new item to be a child of (=parent id).

To create your link, simply use something like:

$item = array(
  'link_path' =&gt; 'node/' . $node-&gt;nid,
  'link_title' =&gt; $node-&gt;title,
  'plid' =&gt; 426,
);
menu_link_save($item);