Extension:Moderation/Hooks/ModerationIntercept

From MediaWiki.org
Jump to navigation Jump to search
ModerationIntercept
Available from version 1.27.0
Allows to stop Extension:Moderation from intercepting an edit
Define function:
public static function onModerationIntercept( WikiPage $page, User $user, Content $content, $summary, $is_minor, $is_watch, $section, $flags, Status $status ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ModerationIntercept": "MyExtensionHooks::onModerationIntercept"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ModerationIntercept'][] = 'MyExtensionHooks::onModerationIntercept';
Called from:File(s): ModerationEditHooks.php

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

Details[edit]

When non-automoderated user makes an edit/upload, Extension:Moderation calls this hook before starting to queue this edit for moderation.

If the hook returns false, this edit will be applied immediately (completely bypassing Moderation).
If the hook returns true, Moderation will intercept the edit.

Arguments are the same as in PageContentSave hook.