Create a menu item with arguments I am trying to manually create a menu link item in the User Menu that contains a wildcard, But I cant make it work.  I can get it to work if I have a static path, but I cant get it to work with wildcards args

function hook_menu() {
  $items['user/%user/bookmarks'] = array(
    'title' =&gt; 'My Bookmarks',
    'description' =&gt; 'Link to My Bookmarks',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; 'user_is_logged_in',
    'type' =&gt; MENU_NORMAL_ITEM,
    'menu_name' =&gt; 'user-menu'
  );

  return $items;
}
When I tried to use user wildcards first, I too came across this problem; and after some trial and error, found that the %user wildcard doesn't work with the menu type MENU_NORMAL_ITEM, instead it works if the type is MENU_LOCAL_TASK.

So, the code should be:

function hook_menu() {
  $items['user/%user/bookmarks'] = array(
    'title' =&gt; 'My Bookmarks',
    'description' =&gt; 'Link to My Bookmarks',
    'page arguments' =&gt; array(1),
    'access callback' =&gt; 'user_is_logged_in',
    'type' =&gt; MENU_LOCAL_TASK,
    'menu_name' =&gt; 'user-menu'
  );

  return $items;
}


Usually, this menu type is rendered as a tab in user menu.

I didn't get enough time to figure out why it doesn't work with MENU_LOCAL_TASK, but when I do find the reason, I'll post it back.