MediaWiki master
MediaWiki\Parser\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\Parser\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&$variableCacheDeprecated since 1.35 and unused since 1.39
string$magicWordIdNormalized, canonical id for the magic word. Each extension should check if it is responsible for the given magic word (registered via GetMagicVariableIDs).
string&$retValue of the magic word. For magic words which an extension has registered with the GetMagicVariableIDs hook, the extension should use this hook to set $ret to a non-null string; it should be left untouched otherwise.
PPFrame$framePPFrame object to use for expanding any template variables
Returns
true|void True or no return value

Implemented in MediaWiki\HookContainer\HookRunner.


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