function token_info

7.x token_info()

Returns metadata describing supported tokens.

The metadata array contains token type, name, and description data as well as an optional pointer indicating that the token chains to another set of tokens.

For example:

  $data['types']['node'] = array(
    'name' => t('Nodes'),
    'description' => t('Tokens related to node objects.'),
  $data['tokens']['node']['title'] = array(
    'name' => t('Title'),
    'description' => t('The title of the current node.'),
  $data['tokens']['node']['author'] = array(
    'name' => t('Author'),
    'description' => t('The author of the current node.'),
    'type' => 'user',

Return value

An associative array of token information, grouped by token type.

3 string references to 'token_info'
hook_hook_info in drupal/modules/system/system.api.php
Defines one or more hooks that are exposed by a module.
hook_hook_info_alter in drupal/modules/system/system.api.php
Alter information from hook_hook_info().
system_hook_info in drupal/modules/system/system.module
Implements hook_hook_info().


drupal/includes/, line 257
Drupal placeholder/token replacement system.


function token_info() {
  $data = &drupal_static(__FUNCTION__);
  if (!isset($data)) {
    $data = module_invoke_all('token_info');
    drupal_alter('token_info', $data);
  return $data;