You are here

function field_collection_token_info_alter in Field collection 7

Implements hook_token_info_alter().

Inject an additional 'host' token to the 'field_collection_item' token type.


./, line 56
Provides host entity tokens for field_collection.module.


function field_collection_token_info_alter(&$data) {
  $data['types']['field_collection_item'] = array(
    'name' => t('Field collection'),
    'description' => t('Tokens related to field collection.'),
    'needs-data' => 'field_collection_item',
  $data['tokens']['field_collection_item']['host'] = array(
    'name' => t('Host entity'),
    'description' => t('The host entity of this field collection item.'),
    'type' => 'host',