Manual:Hooks/UserIsBot

From MediaWiki.org
Jump to navigation Jump to search
UserIsBot
Available from version 1.28.0 (Gerrit change 287433)
Occurs when determining whether a user is a bot account
Define function:
public static function onUserIsBot( User $user, bool &$isBot ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserIsBot": "MyExtensionHooks::onUserIsBot"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UserIsBot'][] = 'MyExtensionHooks::onUserIsBot';
Called from:File(s): user/User.php
Function(s): isBot

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

Details[edit]

  • $user: The user object
  • &$isBot: whether this is user a bot or not (boolean)