You are here

function linked_field_tokens in Linked Field 7

Implements hook_tokens().

Replace our tokens that we provide in linked_field_token_info().

File

./linked_field.module, line 82
Main file of Linked Field module.

Code

function linked_field_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  if ($type == 'field-item') {
    foreach ($tokens as $name => $original) {
      $replacements[$original] = $data['field-item'][$name];
    }
  }
  return $replacements;
}