The 'title_callback' and 'description_callback', which are explained on [#140311], are missing from the hook_menu reference for D6/D7.

Marking critical because this is a fundamental hook and these properties are used in basic core modules like user.module so it is about as critical as one can find for a doc issue.

Comments

fgm’s picture

Of course, [#140311] means http://drupal.org/node/140311

I thought that filter worked for all of d.o. pages, not just issues.

Anonymous’s picture

Project: Documentation » Drupal core
Version: » 7.x-dev
Component: Documentation in CVS » documentation

moved to Drupal 7

jody lynn’s picture

Status: Active » Needs work
StatusFileSize
new1.66 KB

I added in a description of 'title callback' and 'title arguments'. I don't think there is a 'description callback'.

However I'm concerned that there is no explanation of how the wildcards work when they are passed on as arguments. This cost me a good bit of time the other day when encountering it for the first time and will baffle many others too I'm sure. The current text:
Integer values pass the corresponding URL component (see arg())
does not come close to explaining the way the wildcards are processed via _load functions.
I'm not sure where to add that into the doc though.

keith.smith’s picture

Minor, but that patch is slightly inconsistent with the use of spacing between sentences.

jody lynn’s picture

StatusFileSize
new1.66 KB

Ah. Alignment fix attached.

rfay’s picture

Status: Needs work » Reviewed & tested by the community

IMO, this one was thoroughly hashed out and should now be committed.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

dale42’s picture

Status: Needs work » Active

I can't find the issue queue issue, but this has already been fixed.

The new text added by this patch:

+ *   - "title": Required (unless title callback is provided). The untranslated 
+ *     title of the menu item.
+ *   - "title callback": The function to call to modify the title.  Takes $title,
+ *     the title, as a parameter if no title arguments are defined.
+ *   - "title arguments": An array of arguments to pass to the title callback
+ *     function.  Integer values pass the corresponding URL component (see arg()).

The current Drupal 7 menu.api.php text:

 *   - "title": Required. The untranslated title of the menu item.
 *   - "title callback": Function to generate the title, defaults to t().
 *     If you require only the raw string to be output, set this to FALSE.
 *   - "title arguments": Arguments to send to t() or your custom callback.

It was fixed in this CVS patch: http://cvs.drupal.org/viewvc.py/drupal/drupal/modules/menu/menu.api.php?...

dale42’s picture

Status: Active » Closed (duplicate)