MediaWiki REL1_40
MediaWiki\Hook\ParserGetVariableValueSwitchHook Interface Reference

This is a hook handler interface, see docs/Hooks.md. More...

Inherited by MediaWiki\HookContainer\HookRunner.

Public Member Functions

 onParserGetVariableValueSwitch ( $parser, &$variableCache, $magicWordId, &$ret, $frame)
 This hook is called when the parser needs the value of a custom magic word.
 

Detailed Description

This is a hook handler interface, see docs/Hooks.md.

Use the hook name "ParserGetVariableValueSwitch" to register handlers implementing this interface.

Stability: stable
to implement

Definition at line 15 of file ParserGetVariableValueSwitchHook.php.

Member Function Documentation

◆ onParserGetVariableValueSwitch()

MediaWiki\Hook\ParserGetVariableValueSwitchHook::onParserGetVariableValueSwitch ( $parser,
& $variableCache,
$magicWordId,
& $ret,
$frame )

This hook is called when the parser needs the value of a custom magic word.

Since
1.35
Parameters
Parser$parser
array&$variableCacheArray to cache the value; when you return $variableCache[$magicWordId] should be the same as $ret
string$magicWordIdIndex of the magic word (hook should not mutate it!)
string&$retValue of the magic word (the hook should set it)
PPFrame$framePPFrame object to use for expanding any template variables
Returns
bool|void True or no return value to continue or false to abort
Note
Setting $variableCache[$magicWordId] is no longer necessary since MW 1.39, but hooks may wish to do so for backward compatibility.

Implemented in MediaWiki\HookContainer\HookRunner.


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