Manual:Hooks/UserIsBlockedGlobally

From MediaWiki.org
Jump to navigation Jump to search
UserIsBlockedGlobally
Available from version 1.14.0
Runs before User::mBlockedGlobally is set; can be used to change the blocked status of an IP address or a user
Define function:
public static function onUserIsBlockedGlobally( &$user, $ip, &$blocked ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserIsBlockedGlobally": "MyExtensionHooks::onUserIsBlockedGlobally"
	}
}

For MediaWiki ≤1.25:

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

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

Details[edit]

  • &$user: User object
  • $ip: IP address of current user
  • &$blocked: blocked flag