Manual:Hooks/ImportHandleUnknownUser

From MediaWiki.org
Jump to navigation Jump to search
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"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ImportHandleUnknownUser'][] = 'MyExtensionHooks::onImportHandleUnknownUser';
Called from:File(s): import/WikiImporter.php, ../maintenance/cleanupUsersWithNoId.php
Function(s): prefixUsername

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

Details[edit]

  • $name - User name