Manual:Hooks/RenameUserPreRename

RenameUserPreRename
Available from version 1.40.0
Before renaming an user
Define function:
public static function onRenameUserPreRename( $uid, $oldName, $newName ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"RenameUserPreRename": "MediaWiki\\Extension\\MyExtension\\Hooks::onRenameUserPreRename"
	}
}
Called from: File(s): RenameUser/RenameuserSQL.php
Function(s): rename
Interface: RenameUserPreRenameHook.php

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