Manual:Hooks/AbortMove

From MediaWiki.org
Jump to: navigation, search
AbortMove
Available from version 1.12.0
Removed in version 1.25.0
Allows canceling the move of one title to another
Define function:
public static function onAbortMove( Title $oldTitle, Title $newTitle, User $user, &$error, $reason ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AbortMove": [
			"MyExtensionHooks::onAbortMove"
		]
	}
}

For MediaWiki ≤1.25:

$wgHooks['AbortMove'][] = 'MyExtensionHooks::onAbortMove';
Called from: File(s): Title.php
Function(s): Title::isValidMoveOperation()

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

This hook is completely removed in favor of Manual:Hooks/MovePageIsValidMove.

Details[edit]

  • $oldtitle: Title that is being moved
  • $newtitle: Destination Title
  • $user: User requesting the move
  • &$error: Error message (if function returns false)
  • $reason: Reason for the move (added in version 1.13)

See also[edit]