Manual:Hooks/MagicWordwgVariableIDs

From MediaWiki.org
Jump to navigation Jump to search
MagicWordwgVariableIDs
Available from version 1.6.1
Tells MediaWiki that one or more magic word IDs should be treated as variables.
Define function:
public static function onMagicWordwgVariableIDs( &$aCustomVariableIds ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"MagicWordwgVariableIDs": "MyExtensionHooks::onMagicWordwgVariableIDs"
	}
}

For MediaWiki ≤1.25:

$wgHooks['MagicWordwgVariableIDs'][] = 'MyExtensionHooks::onMagicWordwgVariableIDs';
Called from: File(s): MagicWord.php

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

Usage[edit]

This function is part of a collection of function hooks used to define custom variables. For an overview of this hook and how it fits into the overall process of defining and registering user defined variables, please see Manual:Variables.

See also[edit]