function hook_token_info_alter(&$data) {
  // Modify description of node tokens for our site.
  $node['nid'] = array(
    'name' => t("Node ID"),
    'description' => t("The unique ID of the article."),
  );
  $node['title'] = array(
    'name' => t("Title"),
    'description' => t("The title of the article."),
  );

  // Chained tokens for nodes.
  $node['created'] = array(
    'name' => t("Date created"),
    'description' => t("The date the article was posted."),
    'type' => 'date',
  );
}

Notice that the parameter by reference $data is never actually altered.

CommentFileSizeAuthor
#1 734944-hook_token_info_alter-D7.patch1.03 KBDave Reid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Needs review
FileSize
1.03 KB
Dave Reid’s picture

Issue tags: +token
Dave Reid’s picture

Issue tags: +Novice

Adding novice tag

Dries’s picture

Status: Needs review » Fixed

Yep. Committed to CVS HEAD. Thanks Dave.

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -token

Automatically closed -- issue fixed for 2 weeks with no activity.