Change Menu Link Title Dynamically Requirements:

Change the Navigation block link "Add Listing" based on role.
This is the built in Navigation block and I've renamed Add Content to Add Listing



I've tried all the solutions here.  Though I admit I am probably doing it wrong.

Change menu link title dynamically?
How do I modify a menu link title dynamically?
How do I dynamically change the title of a menu link?

I've created a module with the following code:

function mymodule_menu_alter(&amp;$items) {
  $item['options']['alter'] = TRUE;
  $items['node/add']['access callback'] = '_accesscheck';
  $items['node/add']['title callback'] = 'mymodule_title_callback';
    var_dump($items);
}

function mymodule_title_callback($arg1) {
    $title = 'New Title';
    return $title;
}

function _accesscheck(){
  global $user;
  return $user-&gt;uid;
}


This is a var_dump snippet of what I'm after:

["node/add"]=&gt;
  array(5) {
    ["title"]=&gt;
    string(11) "Add content"
    ["page callback"]=&gt;
    string(13) "node_add_page"
    ["access callback"]=&gt;
    string(16) "_node_add_access"
    ["file"]=&gt;
    string(14) "node.pages.inc"
    ["module"]=&gt;
    string(4) "node"
  }


Before I attempt to include roles I'm just trying to get the link to change.
Just tried your code (trimmed down) and it worked without any problems. I simply overwrote the "title callback", like you did. I tried it with admin and anonymous account, see the screenshots for the end result below:



I also added, as an extra precaution, a module_implements_alter implementation. With that hook, you can push your menu_alter implementation to the end of the hook_menu_alter list. That way you can make sure it gets executed after every other menu_alter, in case there was some competing implementation there.

&lt;?php

/**
 * Implements hook_menu_alter().
 */
function mymodule_menu_alter(&amp;$items) {
  $items['node/add']['title callback'] = 'mymodule_title_callback';
}

function mymodule_title_callback($arg1) {
  global $user;
  $title = 'New Title';
  if( $user-&gt;uid == 0 ) {
    $title = 'New Title for anonymous';
  }
  return $title;
}

/**
 * Implements hook_module_implements_alter().
 */
function mymodule_module_implements_alter(&amp;$implementations, $hook) {
  if ($hook != 'menu_alter') {
    return;
  }

  $module = 'mymodule';
  $group = array($module =&gt; $implementations[$module]);
  unset($implementations[$module]);
  $implementations = $implementations + $group;
}


Hope you can get this to work!