Jump to navigation Jump to search
Available from version 1.18.0 (r84134)
Called when removing a group from an user.
Define function:
public static function onUserRemoveGroup( $user, &$group ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"UserRemoveGroup": "MyExtensionHooks::onUserRemoveGroup"

For MediaWiki ≤1.25:

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

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


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