Is there a way to pass multiple arguments to menu_name while creating menu links programmatically? Am using Drupal 7.
Below is my code where am trying to create menu links programmatically:

$links[] = array(
'menu_name' =&gt; 'management',
'link_path' =&gt; 'myheader/config',
'link_title' =&gt; 'Header Settings',
'options' =&gt; array(),
'weight' =&gt; 2,
'parent' =&gt; 'custom/header-settings',
);
$links[] = array(
'menu_name' =&gt; 'mycustommenu',
'link_path' =&gt; 'myheader/config',
'link_title' =&gt; 'Header Settings',
'options' =&gt; array(),
'weight' =&gt; 2,
'parent' =&gt; 'custom/header-settings',
);


In the above code, only menu_name is different. Rest of them are same. Is there a way to pass multiple arguments to menu_name?
No. When you're building links for D7's menu system, you'll need to specify the entire link array because you're creating link metadata here. If you're trying to keep your code DRY you could try to create a template array (or function) then copy/update as you needed new links, but you're probably doing just as much work for little/no performance gain or clarity.