Merge "docs: Update ParserGetVariableValueSwitch documentation"

This commit is contained in:
jenkins-bot 2019-11-15 04:29:59 +00:00 committed by Gerrit Code Review
commit 8aafbfc02f
2 changed files with 7 additions and 7 deletions

View file

@ -2586,12 +2586,12 @@ $rev: Revision object of the template
'ParserGetVariableValueSwitch': Called when the parser need the value of a
custom magic word
&$parser: Parser object
&$varCache: array to store the value in case of multiples calls of the
$parser: Parser object
&$variableCache: array to store the value in case of multiples calls of the
same magic word
&$index: index (string) of the magic
&$magicWordId: index (string) of the magic word
&$ret: value of the magic word (the hook should set it)
&$frame: PPFrame object to use for expanding any template variables
$frame: PPFrame object to use for expanding any template variables
'ParserGetVariableValueTs': Use this to change the value of the time for the
{{LOCAL...}} magic word.

View file

@ -49,9 +49,9 @@ function wfAddCustomMagicWordID( &$magicWords ) {
return true;
}
function wfGetCustomMagicWordValue( &$parser, &$varCache, &$index, &$ret ){
if( $index == 'mag_custom' ){
$ret = $varCache['mag_custom'] = "Custom value";
function wfGetCustomMagicWordValue( $parser, &$variableCache, &$magicWordId, &$ret ){
if( $magicWordId == 'mag_custom' ){
$ret = $variableCache['mag_custom'] = "Custom value";
}
return true;
}