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": "MediaWiki\\Extension\\MyExtension\\Hooks::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.


Details

edit
  • $name - User name
  NODES
HOME 1
languages 2
text 2
Users 1