Jump to content

Manual:Hooks/UserIsBot

From mediawiki.org
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": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserIsBot"
	}
}
Called from: File(s): user/User.php
Function(s): isBot
Interface: UserIsBotHook.php

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)