Manual:Hooks/AddNewAccountApiForm

From MediaWiki.org
Jump to navigation Jump to search
AddNewAccountApiForm
Available from version 1.23.0 (Gerrit change 106844)
Removed in version 1.27.0
Allows modifying the internal login form when creating an account via the API.
Define function:
public static function onAddNewAccountApiForm( $apiModule, $loginForm ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"AddNewAccountApiForm": "MyExtensionHooks::onAddNewAccountApiForm"
	}
}

For MediaWiki ≤1.25:

$wgHooks['AddNewAccountApiForm'][] = 'MyExtensionHooks::onAddNewAccountApiForm';
Called from:File(s): api/ApiCreateAccount.php

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

In MediaWiki 1.27, the hook has been removed and replaced by AuthManager functionality. Extensions which support AuthManager don't need to do anything special, API support is built in.