You are here

function profile_token_info in Token 7

Implements hook_token_info() on behalf of profile.module.

File

./token.tokens.inc, line 1181
Token callbacks for the token module.

Code

function profile_token_info() {
  $info = array();
  foreach (_token_profile_fields() as $field) {
    $info['tokens']['user'][$field->token_name] = array(
      'name' => check_plain($field->title),
      'description' => t('@category @type field.', array(
        '@category' => drupal_ucfirst($field->category),
        '@type' => $field->type,
      )),
    );
    switch ($field->type) {
      case 'date':
        $info['tokens']['user'][$field->token_name]['type'] = 'date';
        break;
    }
  }
  return $info;
}