Open main menu

Extension:UserMerge/Hooks/UserMergeAccountDeleteTables

< Extension:UserMerge(Redirected from Extension:UserMerge/UserMergeAccountDeleteTables)
UserMergeAccountDeleteTables
Available from version ??? (Gerrit change 160846)
define database tables to automatically delete records from when a user is deleted
Define function:
public static function onUserMergeAccountDeleteTables( &$tablesToDelete ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserMergeAccountDeleteTables": "MyExtensionHooks::onUserMergeAccountDeleteTables"
	}
}

For MediaWiki ≤1.25:

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

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

DetailsEdit

  • &$tablesToDelete: an associative array of table_name => user_id_field key/value pairs. (Alternatively, the value can be in the form array( user_id_field, 'db' => $db ) if a custom Database object is needed.) Rows matching the user ID will be deleted from the table.

If the delete operation is too complex to be handled this way, DeleteAccount can be used instead.