Manual:Hooks/PingLimiter

Category:MediaWiki hooks#PingLimiter Category:Hooks added in MediaWiki 1.9.0#PingLimiter
PingLimiter
Available from version 1.9.0
Allows extensions to override the results of User::pingLimiter()
Define function:
public static function onPingLimiter( &$user, $action, &$result ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PingLimiter": "MediaWiki\\Extension\\MyExtension\\Hooks::onPingLimiter"
	}
}
Called from: File(s): user/User.phpCategory:MediaWiki hooks included in User.php#PingLimiter
Interface: PingLimiterHook.php

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

Details

  • &$user : User performing the action.
  • $action : Action being performed.
  • &$result : Whether or not the action should be prevented. Change $result and return false to give a definitive answer, otherwise the built-in rate limiting checks are used, if enabled.
Category:Hooks added in MediaWiki 1.9.0 Category:MediaWiki hooks Category:MediaWiki hooks included in User.php