I'm reading through Pro Drupal development right now, and an example on page 82 uses the following function:
function menufun_menu_link_alter(&$item, $menu){
if ($item['link_path'] == 'logout'){
$item['link_title'] = 'Sign off';
}
}
I understand that I can find out what parameters "hook_menu_link_alter" takes by looking at api.drupal.org. What I don't understand is how I'm supposed to find out what $item actually contains. In this example, $item['link_path'] and $item['link_title'] were both used - how did he know they existed?
I'm not only interested in this specific example, of course. I want to be able to do this for any function that I look at in drupal.
Thanks in advance for the help!