Manual:Hooks/UnblockUser

Category:MediaWiki hooks#UnblockUser Category:Hooks added in MediaWiki 1.29.0#UnblockUser
UnblockUser
Available from version 1.29.0 (Gerrit change 329725)
Occurs whenever the software receives a request to unblock an IP address or user
Define function:
public static function onUnblockUser( &$block, &$user, &$reason ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UnblockUser": "MediaWiki\\Extension\\MyExtension\\Hooks::onUnblockUser"
	}
}
Called from: File(s): SpecialUnblock.phpCategory:MediaWiki hooks included in SpecialUnblock.php#UnblockUser
Interface: UnblockUserHook.php

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

Details

This occurs before an IP address or user is unblocked.

  • $block: the Block object about to be saved
  • $user: the user doing the unblock (not the one being unblocked)
  • &$reason: if the hook is aborted, the error message in an array, by default: array( 'hookaborted' )

See also

Category:Hooks added in MediaWiki 1.29.0 Category:MediaWiki hooks Category:MediaWiki hooks included in SpecialUnblock.php