Manual:Hooks/BlockIpComplete

From MediaWiki.org
Jump to navigation Jump to search
BlockIpComplete
Available from version 1.4.0
Occurs after the request to block an IP or user has been processed
Define function:
public static function onBlockIpComplete( Block $block, User $user, ?Block $priorBlock ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"BlockIpComplete": "MyExtensionHooks::onBlockIpComplete"
	}
}

For MediaWiki ≤1.25:

$wgHooks['BlockIpComplete'][] = 'MyExtensionHooks::onBlockIpComplete';
Called from:File(s): specials/SpecialBlock.php

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

Details[edit]

  • $block: the Block object that was saved
  • $user: the user who did the block (not the one being blocked)
  • $priorBlock: the Block object for the prior block or null if there was none

See also[edit]