MediaWiki REL1_35
MediaWiki\Api\Hook\APIQueryUsersTokensHook Interface Reference
Inheritance diagram for MediaWiki\Api\Hook\APIQueryUsersTokensHook:

Public Member Functions

 onAPIQueryUsersTokens (&$tokenFunctions)
 Use this hook to add custom token to list=users.

Detailed Description

since 1.24 Use ApiQueryTokensRegisterTypes instead.

Definition at line 9 of file APIQueryUsersTokensHook.php.

Member Function Documentation

◆ onAPIQueryUsersTokens()

MediaWiki\Api\Hook\APIQueryUsersTokensHook::onAPIQueryUsersTokens ( $tokenFunctions)

Use this hook to add custom token to list=users.

Every token has an action, which will be used in the ustoken parameter and in the output (actiontoken="..."), and a callback function which should return the token, or false if the user isn't allowed to obtain it. The prototype of the callback function is func($user) where $user is the User object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).

array&$tokenFunctions[ action => callback ]
bool|void True or no return value

Implemented in MediaWiki\Api\ApiHookRunner.

The documentation for this interface was generated from the following file: