Manual:Hooks/UserCreateForm

Category:MediaWiki hooks#UserCreateForm Category:Hooks added in MediaWiki 1.6.0#UserCreateForm Category:MediaWiki deprecated or obsolete features#UserCreateForm Category:Hooks removed in MediaWiki 1.33.0#UserCreateForm Category:Hooks deprecated in MediaWiki 1.27.0#UserCreateForm
UserCreateForm
Available from version 1.6.0
Removed in version 1.33.0 (Gerrit change 441513)Category:Removed hooks#UserCreateForm
Manipulate the user create form
Define function:
public static function onUserCreateForm( &$template ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserCreateForm": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserCreateForm"
	}
}
Called from: File(s): specials/SpecialUserLogin.phpCategory:MediaWiki hooks included in SpecialUserLogin.php#UserCreateForm
Interface: UserCreateFormHook.php

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

Details

  • &$template: SimpleTemplate instance for the form

Deprecated

From MediaWiki 1.27 on, the hook is deprecated and superseded by AuthManager functionality. User creation form fields should be added by some authentication provider returning an instance of an appropriate AuthenticationRequest subclass instance in getAuthenticationRequests(), and that object can define the fields via getFieldInfo(). The authentication provider can read the submitted data from the AuthenticationRequest object via its testForAccountCreation or beginPrimaryAccountCreation/continuePrimaryAccountCreation methods.

For purely cosmetic changes to the form, which don't need to be reflected to the API (such as adding more information or interactive widgets) the AuthChangeFormFields hook can be used.

See also

Category:Hooks added in MediaWiki 1.6.0 Category:Hooks deprecated in MediaWiki 1.27.0 Category:Hooks removed in MediaWiki 1.33.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in SpecialUserLogin.php Category:Removed hooks