Jump to content

Manual:Hooks/UserRemoveGroup

From mediawiki.org
UserRemoveGroup
Available from version 1.18.0 (r84134, codereview)
Called when removing a group from an user.
Define function:
public static function onUserRemoveGroup( $user, &$group ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserRemoveGroup": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserRemoveGroup"
	}
}
Called from: File(s): User.php
Interface: UserRemoveGroupHook.php

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


Details

[edit]

Return false to override stock group removal.

  • $user: the user object that is to have a group removed
  • &$group: the group to be removed, can be modified