From MediaWiki.org
Jump to navigation Jump to search
Available from version 1.19 (r89147)
trigger update actions somewhere else when account "fromUser" is merged into account "toUser" by the UserMerge and Delete action
Define function:
public static function onMergeAccountFromTo( &$fromUser, &$toUser ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"MergeAccountFromTo": "MyExtensionHooks::onMergeAccountFromTo"

For MediaWiki ≤1.25:

$wgHooks['MergeAccountFromTo'][] = 'MyExtensionHooks::onMergeAccountFromTo';
Called from:File(s): UserMerge extension

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


  • &$fromUser: user object of the "merge from" (source) account
  • &$toUser: user object of the "merge to" (target) account

Used to update user data stored by extensions. If the only update needed is to change the user ID or name (no records need to be merged etc.), UserMergeAccountFields is a better alternative.