I try to enable the menu link programmatically, here is how I do it:
function create_menu_link() {
$node = new stdClass();
$node->type = 'mytype';
node_object_prepare($node);
$node->menu['link-title'] = $menu_title;
node_save($node);
}
But setting only the title is not working. In $node->menu
there is some other variables like mlid
and plid
which are set to 0
it has to do with this ? The menu_name
is set to main-menu:0
, module
is set to menu
.