Node creation PHP – menu item under proper parent while I create node by PHP, I use this:

$node-&gt;menu['enabled'] = true;
$node-&gt;menu['link_title'] = $node-&gt;title;


but it puts link in 0 depth of the menu. It doesn't care for "Default parent" selected for content type. Neither this works:

$node-&gt;menu['parent'] = "menu-global-menu:961";


How to select parent then?
It looks like you need to set $node-&gt;menu['plid'] = "961"; to set the parent node. 

You can have a look through the menu_link_save doco to get an idea of what is going on, or there is a smaller code snippet on this blog that explains in a simple, fast way.

As a side note, you can use node_object_prepare($node); to set default values after setting your node type, which should take care of your default menu parent. I've found this guide helpful with programmatic node creation.