Jump to content


From mediawiki.org
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": "MediaWiki\\Extension\\MyExtension\\Hooks::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.


  • $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.


  • Return false to cancel an autoblock.