Manual:Hooks/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.php
Interface: UnblockUserHook.php

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


Details

edit

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

edit