Manual:Hooks/UserGetEmail

From MediaWiki.org
Jump to navigation Jump to search
UserGetEmail
Available from version 1.13.0
Called when getting an user email address.
Define function:
public static function onUserGetEmail( $user, &$email ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserGetEmail": "MyExtensionHooks::onUserGetEmail"
	}
}

For MediaWiki ≤1.25:

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

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

Details[edit]

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

See also[edit]