You are here

function hook_api_tokens_render_alter in API Tokens 7

Alter the output of rendered API token.

Parameters

string $rendered: Rendered API token.

array $info: An associative array containing following keys:

  • key: API token key;
  • params: an array of API token parameters;
  • token: original API token that will be replaced with rendered content;
  • parents: an array of parent tokens (if rendered content for token "A"

contains token "B", parents array of token "B" will contain token "A").

See also

api_tokens_render()

File

./api_tokens.api.php, line 107
Hooks provided by the API Tokens module.

Code

function hook_api_tokens_render_alter(&$rendered, $info) {
  if ('demo' == $info['key'] && 'wrap' == $info['params'][0]) {
    $rendered = '<div class="' . $info['params'][1] . '">' . $rendered . '</div>';
  }
}