Manual:Hooks/EmailUserPermissionsErrors

From MediaWiki.org
Jump to navigation Jump to search
EmailUserPermissionsErrors
Available from version 1.16.0
Retrieve permissions errors for emailing a user.
Define function:
public static function onEmailUserPermissionsErrors( $user, $editToken, &$hookErr ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"EmailUserPermissionsErrors": "MyExtensionHooks::onEmailUserPermissionsErrors"
	}
}

For MediaWiki ≤1.25:

$wgHooks['EmailUserPermissionsErrors'][] = 'MyExtensionHooks::onEmailUserPermissionsErrors';
Called from:File(s): SpecialEmailuser.php

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

Details[edit]

  • $user: The user who is trying to email another user.
  • $editToken: The user's edit token.
  • &$hookErr: Out-param for the error. Passed as the parameters to OutputPage::showErrorPage.