Jump to content

Template:Is temporary account/doc

From Calamity Wiki
Revision as of 00:45, 18 December 2025 by imported>CapnZapp (make it easier for non-technical readers to understand why seven characters are compared (it's because ~2 isn't two characters, it's seven). Yes I know it is obvious to a programmer...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This metatemplate determines whether a user is a temporary account.

Usage

Use {{Is temporary account}} to determine whether the user identified in the current page title (e.g. User talk:~2025-00000-00) is a temporary account.

Alternatively, use {{Is temporary account|user}} to determine whether the specified user is a temporary account, replacing user with the username to evaluate.

The template returns 1 if the user is a temporary account, and a blank output if the user is not a temporary account.

Implementation

The template compares the first two characters of the username to ~2, a username prefix exclusively used by all temporary accounts. (There are no existing registered users with usernames starting with ~2, and attempting to register a new account with a username starting with ~2 returns an error.)

If no username is specified, the template uses the {{BASEPAGENAME}} magic word to obtain the username from the page title. {{BASEPAGENAME}} encodes the tilde (~) symbol as ~. For example, {{BASEPAGENAME}} would return ~2025-00000-00 on the page User talk:~2025-00000-00. Because of how this makes ~2 seven characters, not two; the template compares the first seven characters of the base page title as encoded by {{BASEPAGENAME}} to ~2 in order to determine whether the user identified in the page title is a temporary account.

TemplateData

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Is temporary account in articles based on its TemplateData.

TemplateData for Is temporary account

Determines whether a user is a temporary account

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Usernameuser 1

Username to evaluate. Defaults to {{BASEPAGENAME}} if unspecified.

Default
{{BASEPAGENAME}}
Example
~2025-00000-00
Useroptional

Examples

{{Is temporary account}}



{{Is temporary account|~2025-00000-00}}

1


{{Is temporary account|Example}}



See also