Manual:Hooks/ChangeUserGroups
ChangeUserGroups | |
---|---|
Available from version 1.29.0 (Gerrit change 329727) Called before a user's group memberships are changed | |
Define function: | public static function onChangeUserGroups( $performer, $user, &$add, &$remove ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ChangeUserGroups": "MediaWiki\\Extension\\MyExtension\\Hooks::onChangeUserGroups"
}
}
|
Called from: | File(s): specials/SpecialUserrights.php |
Interface: | ChangeUserGroupsHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:ChangeUserGroups extensions.
Details
editThis occurs before a user's group memberships are changed.
- $performer: The User who will perform the change
- $user: The User whose groups will be changed
- &$add: The groups that will be added
- &$remove: The groups that will be removed