Manual:Hooks/LanguageGetNamespaces

From MediaWiki.org
Jump to: navigation, search
LanguageGetNamespaces
Available from version 1.19.0 (r95775)
Provide custom ordering for namespaces or remove namespaces.
Define function:
public static function onLanguageGetNamespaces( &$namespaces ) { ... }
Attach hook:
$wgHooks['LanguageGetNamespaces'][] = 'MyExtensionHooks::onLanguageGetNamespaces';
Called from: File(s): Language.php

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


Warning Warning: Do not use this hook to add namespaces. Use CanonicalNamespaces for that.

Details[edit | edit source]

  • &$namespaces: Array of namespaces indexed by their numbers