Manual:Hooks/MakeGlobalVariablesScript

From MediaWiki.org

Jump to: navigation, search
MakeGlobalVariablesScript
Available from version 1.14.0
called right before Skin::makeVariablesScript is executed.

*Define function:
function fnMyHook( &$vars ) { ... }

*Attach hook:
$wgHooks['MakeGlobalVariablesScript'][] = 'fnMyHook';
Called from: Skin.php

*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:MakeGlobalVariablesScript extensions.


[edit] Details

  • &$vars: variable (or multiple variables) to be added into the output of Skin::makeVariablesScript
  • &$wgUser: user (object) who is loading the skin. This was added in r43592 and removed in r43632.