Manual:Hooks/UserSetEmail

From MediaWiki.org
Jump to navigation Jump to search
UserSetEmail
Available from version 1.13.0
Called when changing user email address.
Define function:
public static function onUserSetEmail( User $user, &$email ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserSetEmail": "MyExtensionHooks::onUserSetEmail"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UserSetEmail'][] = 'MyExtensionHooks::onUserSetEmail';
Called from: File(s): User.php

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

Details[edit]

  • $user: User object
  • &$email: new email, change this to override new email address

See also[edit]