1 system.api.php hook_token_info_alter(&$data)

Alter the metadata about available placeholder tokens and token types.

Parameters

$data: The associative array of token definitions from hook_token_info().

See also

hook_token_info()

Related topics

File

core/modules/system/system.api.php, line 3949
Hooks provided by Backdrop core and the System module.

Code

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

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