How to expand menu items by default?
I tried your custom hook call, just to be sure it was called as you imagine, and to see how the $item array was build.

First, according to the hook_menu_link_alter() documentation, their is only one argument to this method in Drupal 7 (&amp;$item).

And when I print the $item element, I can see that the name of the menu of the current element is not 'menu' but 'menu_name'.

Then your code must be something like :

function mymodule_menu_link_alter(&amp;$item) {
  if($item['menu_name'] == 'custom-menu')
  {
    $item['expanded'] = 1;
  }
}


It is an interesting hook, because it is also called when a user add a menu directly from a node form options.