Manual:Hooks/NamespaceIsMovable

From MediaWiki.org
Jump to: navigation, search
NamespaceIsMovable
Available from version 1.20.0
Called when determining if it is possible to move pages, for a particular namespace. This controls moves both to and from the given namespace.
Define function:
public static function onNamespaceIsMovable( $index, $result ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"NamespaceIsMovable": [
			"MyExtensionHooks::onNamespaceIsMovable"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['NamespaceIsMovable'][] = 'MyExtensionHooks::onNamespaceIsMovable';
Called from: File(s): Namespace.php

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

Details[edit]

  • $index: Integer; the index of the namespace being checked.
  • $result: Boolean; whether MediaWiki currently thinks that pages in this namespace are movable. Hooks may change this value to override the return value of MWNamespace::isMovable().