Modifying a single menu link title I'd like to replace the link title on the top link of my secondary navbar (called "explorer", links to "mysite.net/explorer", but actually just triggers a dropdown-menu) with a glyphicon and the current user's name.

According to this thread, a title callback is the way to do this. However, adding this code in my template.php has no effect at all.

function mythemename_menu_alter(&amp;$items) {
  $items['explorer']['title callback'] = 'mythemename_title_callback';
}

function mythemename_title_callback($arg1, $arg2) {
  global $user;
  $title = '&lt;span class="glyphicon glyphicon-user" aria-hidden="true"&gt;&lt;/span&gt;'. $user-&gt;name;

  return $title;
}


What am i doing wrong? And why does the callback function take 2 parameters? (It doesn't work with 1 or 0 params.)

The "menu token" module almost crashed my site after installation, so I don't want to use that.
If you only want to change the title of an menu item, you should be able to do this through the administration. Go to admin/structure/menu and edit the correct item in your secondary menu.

To use hook_menu_alter() you must add it in a custom module not inside your template file. Remember to clear you cache in order for the changes to take effect. To clear the cache you can goto admin/config/development/performance.