diff --git a/token.tokens.inc b/token.tokens.inc index bebff58..12faa81 100644 --- a/token.tokens.inc +++ b/token.tokens.inc @@ -153,6 +153,14 @@ function token_token_info() { 'description' => t('The user roles associated with the user account.'), 'type' => 'array', ); + $info['tokens']['user']['name_themed'] = array( + 'name' => t("Name (themed)"), + 'description' => t("The login name of the user account (themed)."), + ); + $info['tokens']['user']['name_themed_plain'] = array( + 'name' => t("Name (themed plain)"), + 'description' => t("The login name of the user account (themed plain)."), + ); // Current user tokens. $info['tokens']['current-user']['ip-address'] = array( @@ -438,6 +446,12 @@ function token_tokens($type, $tokens, array $data = array(), array $options = ar case 'roles': $replacements[$original] = token_render_array($account->roles, $options); break; + case 'name_themed': + $replacements[$original] = theme('username', array('account' => $account)); + break; + case 'name_themed_plain': + $replacements[$original] = strip_tags(theme('username', array('account' => $account))); + break; } }