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

Public Member Functions

 onAPIQueryRevisionsTokens (&$tokenFunctions)
 Use this hook to add custom tokens to prop=revisions.
 

Detailed Description

Deprecated:
since 1.24 Use ApiQueryTokensRegisterTypes instead.

Definition at line 9 of file APIQueryRevisionsTokensHook.php.

Member Function Documentation

◆ onAPIQueryRevisionsTokens()

MediaWiki\Api\Hook\APIQueryRevisionsTokensHook::onAPIQueryRevisionsTokens ( $tokenFunctions)

Use this hook to add custom tokens to prop=revisions.

Every token has an action, which will be used in the rvtoken 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($pageid, $title, $rev), where $pageid is the page ID of the page associated to the revision the token is requested for, $title the associated Title object and $rev the associated Revision object. In the hook, add your callback to the $tokenFunctions array and return true (returning false makes no sense).

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

Implemented in MediaWiki\Api\ApiHookRunner.


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