Alter menu title or add menu item programmatically? I want to create link to user from the menu created by UI. I tried with hook_menu but the link is 'user', but it doesn't work, because don't want to create new page. I would like to alter title or add menu item programmicaly to use First name in the the menu title.

What i know is the 'mlid' = '3228' and menu name is 'menu-user-links-top'

PS. I also tried with hook_menu_link_alter but it doesn't work, for all users (the first name appears after pressing edit menu and uses only admin's first name).
For example, if I take the User-Menu in bartik theme, and I want to change the My Account menu-title with Username, So whenever, the user logged in, instead of My Account that menu-item shown the Username.

Image-1: Default menu-item


  


Image-2: After the code 



function YOURTHEMENAME_translated_menu_link_alter(&amp;$item, $map) {
    global $user;
    if ($item['href'] == 'user') {
      $item['title'] = t($user-&gt;name);
    }
}


Now, same way as shown in the above code, you can change the apply the href of any particular menu-item and there it will show the user-name instead of the menu-title.

I am not sure are you looking for this or other, but this is the straight code to change the men-item with username.