Extension:Renameuser/RenameUserPreRename

From MediaWiki.org
Jump to navigation Jump to search
RenameUserPreRename
Available from version 1.13
Before renaming an user
Define function:
public static function onRenameUserPreRename( $uid, $oldName, $newName ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"RenameUserPreRename": "MyExtensionHooks::onRenameUserPreRename"
	}
}

For MediaWiki ≤1.25:

$wgHooks['RenameUserPreRename'][] = 'MyExtensionHooks::onRenameUserPreRename';
Called from:File(s): Renameuser extension

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

Details[edit]

  • $uid: id of the user being renamed
  • $oldName: old name
  • $newName: new name