diff --git a/token.tokens.inc b/token.tokens.inc index e0c0b5e..42091a7 100644 --- a/token.tokens.inc +++ b/token.tokens.inc @@ -358,6 +358,12 @@ function token_token_info() { 'dynamic' => TRUE, ); + // Site tokens. + $info['site']['registration-url'] = array( + 'name' => t('Registration page'), + 'description' => t("The URL of the site's registration page."), + ); + return $info; } @@ -895,6 +901,15 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar } } + // Site tokens. + if ($type == 'site') { + foreach ($tokens as $name => $original) { + if ($name == 'registration-url') { + $replacements[$original] = url('user/register', array('absolute' => TRUE)); + } + } + } + // If $type is a token type, $data[$type] is empty but $data[$entity_type] is // not, re-run token replacements. if (empty($data[$type]) && ($entity_type = token_get_entity_mapping('token', $type)) && $entity_type != $type && !empty($data[$entity_type]) && empty($options['recursive'])) {