Extension:UserMerge/Hooks/MergeAccountFromTo

From Linux Web Expert

Revision as of 13:50, 21 October 2020 by imported>Clump (Reverted edits by 2A03:2880:23FF:12:0:0:FACE:B00C (talk) to last version by SamanthaNguyen)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

MergeAccountFromTo
Available from version 1.19.0 (Gerrit change 89147)
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:
$wgHooks['MergeAccountFromTo'][] = 'MyExtensionHooks::onMergeAccountFromTo';
Called from:File(s): UserMerge / includes/MergeUser.php
Function(s): mergeDatabaseTables

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

Details

  • &$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.