You are here

function og_vocab_token_values in OG Vocabulary 6

Implementation of hook_token_values().

File

./og_vocab.token.inc, line 11
Integration of token module with og_vocab module.

Code

function og_vocab_token_values($type, $object = NULL, $options = array()) {
  if ($type == 'taxonomy' && !empty($object) && ($nid = og_vocab_get_group($object->vid))) {
    $node = node_load($nid['nid']);
    $tokens = array(
      'ogname' => check_plain($node->title),
      'ogname-raw' => $node->title,
      'og-id' => $nid['nid'],
    );
    return $tokens;
  }
}