Manual:Hooks/AbortAutoblock

From mediawiki.org
Jump to navigation Jump to search
AbortAutoblock
Available from version 1.13.0
Allow extension to cancel an autoblock.
Define function:
public static function onAbortAutoblock( string $autoblockIP, DatabaseBlock $block ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"AbortAutoblock": "MyExtensionHooks::onAbortAutoblock"
	}
}
Called from: File(s): block/DatabaseBlock.php
Function(s): doAutoblock
Interface: AbortAutoblockHook.php

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


Details[edit]

  • $autoblockIP: The IP that is going to be autoblocked.
  • $block: An instance of MediaWiki\Block\DatabaseBlock, representing the block from which the autoblock is coming.

Notes[edit]

  • Return false to cancel an autoblock.