You are here

function open_readspeaker_tokens in Open ReadSpeaker 8

Implements hook_tokens().

File

./open_readspeaker.module, line 93
Contains open_readspeaker.module.

Code

function open_readspeaker_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
  $replacements = [];
  if ($type === 'open-readspeaker') {
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'account-id':
          $replacements[$original] = Drupal::config('open_readspeaker.settings')
            ->get('open_readspeaker_accountid');
          break;
      }
    }
  }
  return $replacements;
}