You are here

function instagram_feeds_token_info in Instagram Feeds 8

Implements hook_token_info().

File

./instagram_feeds.tokens.inc, line 17
Provides Token integration for Instagram Feeds.

Code

function instagram_feeds_token_info() {
  $types = $tokens = [];
  $types['instagram-account'] = [
    'name' => t('Instagram Account'),
    'needs-data' => 'instagram_account',
  ];
  $tokens['instagram-account']['username'] = [
    'name' => t('Instagram Account Username'),
  ];
  $tokens['instagram-account']['id'] = [
    'name' => t('Instagram Account id'),
  ];
  $tokens['instagram-account']['author'] = [
    'name' => t('Instagram Account author'),
    'type' => 'user',
  ];
  $types['instagram-post'] = [
    'name' => t('Instagram Post'),
    'needs-data' => 'instagram_post',
  ];
  $tokens['instagram-post']['username'] = [
    'name' => t('Owner Username'),
  ];
  $tokens['instagram-post']['permalink'] = [
    'name' => t('Permalink'),
  ];
  $tokens['instagram-post']['id'] = [
    'name' => t('ID'),
  ];
  $tokens['instagram-post']['caption'] = [
    'name' => t('Caption'),
  ];
  $tokens['instagram-post']['media_type'] = [
    'name' => t('Media Type'),
  ];
  $tokens['instagram-post']['media_url'] = [
    'name' => t('Media URL'),
  ];
  $tokens['instagram-post']['thumbnail_url'] = [
    'name' => t('Thumbnail URL'),
  ];
  $tokens['instagram-post']['date'] = [
    'name' => t('Date'),
    'type' => 'date',
  ];
  $tokens['instagram-post']['tags'] = [
    'name' => t('Hashtags'),
  ];
  $tokens['instagram-post']['full_name'] = [
    'name' => t('Owner Full Name'),
  ];
  return [
    'types' => $types,
    'tokens' => $tokens,
  ];
}