Manual:Hooks/ImportHandleUnknownUser

ImportHandleUnknownUser
Available from version 1.31.0 (Gerrit change 386625)
When a user doesn't exist locally, this hook is called to give extensions an opportunity to auto-create it. If the auto-creation is successful, return false.
Define function:
public static function onImportHandleUnknownUser( $name ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ImportHandleUnknownUser": "MyExtensionHooks::onImportHandleUnknownUser"
	}
}
Called from:File(s): import/WikiImporter.php, ../maintenance/cleanupUsersWithNoId.php
Function(s): prefixUsername
Interface:ImportHandleUnknownUserHook.php

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

DetailsEdit

  • $name - User name