Manual:Hooks/SpecialResetTokensTokens

From MediaWiki.org
Jump to navigation Jump to search
SpecialResetTokensTokens
Available from version 1.22.0 (Gerrit change 64565)
Called when building token list for SpecialResetTokens.
Define function:
public static function onSpecialResetTokensTokens( array &$tokens ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SpecialResetTokensTokens": "MyExtensionHooks::onSpecialResetTokensTokens"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SpecialResetTokensTokens'][] = 'MyExtensionHooks::onSpecialResetTokensTokens';
Called from:File(s): specials/SpecialResetTokens.php
Function(s): getTokensList

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:SpecialResetTokensTokens extensions.

Details[edit]

&$tokens: array of token information arrays in the format of

[
	'preference' => '<preference-name>',
	'label-message' => '<message-key>',
];