Chapter 4. The Menu System, Page 74
There is no error, but the text could be clearer about how things work.
It is important to realize that the arguments passed to the title callback function are completely different depending on whether the callback function is t() or some other function.
In the case of t(), the first argument will be the value set for the menu's title key, and the second argument will be the array of arguments assigned to the menu's title arguments key.
However, if the callback is any other function, it will not receive the value set for the menu's title key, nor will it receive the array of title arguments. Instead, it will receive the values in the array of title arguments, with each value being passed in as its own argument. So, the value of the first item in the title arguments array will be passed in as the first argument to the callback function, etc.
Example:
$items['menutoy/bye'] = array(
'title' => 'bye bye @name',
'title callback' => 'menutoy_title',
'title arguments' => array('@name' => 'foo'),
'access callback' => true,
);
The menutoy_title() function will receive 'foo' as its first and only argument.
On the other hand, if the title callback function is t(), its first argument will be 'bye bye @name', and its second argument will be array('@name' => 'foo').
Thus if one wishes to have the value of the title passed to one's custom title callback function, one will have to make sure to include it as one of the values in the title arguments array.
