Extension:UserMerge/Hooks/DeleteAccount

From Linux Web Expert

Revision as of 12:50, 2 January 2024 by imported>Clump (Reverted edits by 2404:160:8137:8CD8:1:0:F399:92AE (talk) to last version by NicoScribe)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

DeleteAccount
Available from version 1.19.0 (Gerrit change 89147)
trigger update actions somewhere else when an account is deleted by the UserMerge and Delete action
Define function:
public static function onDeleteAccount( &$deletedUser ) { ... }
Attach hook:
$wgHooks['DeleteAccount'][] = 'MyExtensionHooks::onDeleteAccount';
Called from:File(s): UserMerge / includes/MergeUser.php
Function(s): deleteUser

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

Details

  • &$deletedUser: user object of the deleted account

If the only action needed is to delete some table row based on user ID, UserMergeAccountDeleteTables can be used instead.