Manual:Hooks/LanguageGetSpecialPageAliases

From MediaWiki.org
Jump to navigation Jump to search

Note: in 1.9, 1.10 and 1.11, this was misspelled LangugeGetSpecialPageAliases!

LanguageGetSpecialPageAliases
Available from version 1.9.0
Use to define aliases of special pages names depending of the language.
Define function:
public static function onLanguageGetSpecialPageAliases( &$specialPageAliases, $langCode ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"LanguageGetSpecialPageAliases": "MyExtensionHooks::onLanguageGetSpecialPageAliases"
	}
}

For MediaWiki ≤1.25:

$wgHooks['LanguageGetSpecialPageAliases'][] = 'MyExtensionHooks::onLanguageGetSpecialPageAliases';
Called from:File(s): Language.php

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

Note Note: From 1.13 to 1.15, you can use $wgExtensionAliasesFiles .

Details[edit]

  • $specialPageAliases : associative array of magic words synonyms
  • $lang : language code (string)