You are here

function page_title_tokens in Page Title 8.2

Same name and namespace in other branches
  1. 7.2 page_title.tokens.inc \page_title_tokens()
  2. 7 page_title.module \page_title_tokens()

Implements hook_token_values().

File

./page_title.tokens.inc, line 23
Builds placeholder replacement tokens for page titles.

Code

function page_title_tokens($type, $tokens, array $data = array(), array $options = array()) {
  $replacements = array();
  $sanitize = !empty($options['sanitize']);
  if ($type == 'current-page') {
    foreach ($tokens as $name => $original) {
      switch ($name) {
        case 'page-title':
          $replacements[$original] = page_title_get_title(!$sanitize);
          break;
      }
    }
  }
  return $replacements;
}