Alter menu title or add menu item programmatically?
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.