I made a menu in administration, structures, menu. I want to change the title, as it appears on the menu, of one of the links based on the gender of the currently logged in user.
I have found several answers to similar questions but I can't figure out how to implement the solutions. Some of them suggest using hook_menu_alter(&$items) and a separate callback function, but I don't understand the structure of $items. I was hoping to just print out the value of $items, find the string I wanted to change, and change that value in $items in the hook. Apparently, though, you can't debug the $items variable because hook_menu_alter is rarely called. I tried to figure out the structure of $items from a bunch of other questions and answers and I found stuff like this:
Why is 'title' a property of a path? Does this mean that every menu on your site that has a link to that path will display the title that you set the above variable to? What if you wanted a link to a specific path on one menu to have a different label than a link to that path on another menu? Isn't there somewhere I can access and change the title of a menu link like this
$allMenuData['My Custom Menu']['an item on my menu']['title']