Open main menu


< Manual:Hooks
Available from version 1.25.0 (Gerrit change 170520)
Allows to add message keys accepted in the warning url parameter on redirects to Special:UserLogin.
Define function:
public static function onLoginFormValidErrorMessages( &$messages ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"LoginFormValidErrorMessages": "MyExtensionHooks::onLoginFormValidErrorMessages"

For MediaWiki ≤1.25:

$wgHooks['LoginFormValidErrorMessages'][] = 'MyExtensionHooks::onLoginFormValidErrorMessages';
Called from:File(s): SpecialUserLogin.php

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


  • &$messages: Array of messages already added.

Allows to add additional error messages to be accepted in the warning parameter on redirects to Special:UserLogin. The message given in the url parameter is supposed to state why the user should log in. This allows extensions to add further purposes in addition to the message keys already specified in LoginForm::$validErrorMessages.