Manual:Hooks/TitleMove

From MediaWiki.org
Jump to: navigation, search
TitleMove
Available from version 1.22.0
Occurs immediately before a file or other page is moved
Define function:
public static function onTitleMove( Title &$title, Title &$newtitle, User &$user ) { ... }
Attach hook:
$wgHooks['TitleMove'][] = 'MyExtensionHooks::onTitleMove';
Called from: File(s): Title.php
Function(s): Title::moveTo()

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

This hook is in Title::moveTo(), which is called from SpecialMovepage.php and ApiMove.php.

Details[edit]

  • $title: old Title
  • $newtitle: new Title
  • $user: User who is doing the move

See also[edit]