Open main menu

Manual:Hooks/ArticleProtectComplete

< Manual:Hooks
ArticleProtectComplete
Available from version 1.4.0
Occurs after the protect article request has been processed
Define function:
public static function onArticleProtectComplete( &$article, &$user, $protect, $reason, $moveonly ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ArticleProtectComplete": "MyExtensionHooks::onArticleProtectComplete"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ArticleProtectComplete'][] = 'MyExtensionHooks::onArticleProtectComplete';
Called from:File(s): Article.php

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

DetailsEdit

  • $article: the article object that was protected
  • $user: the user object who did the protection
  • $protect: array of page restrictions indexed by permission (e.g. ["move"=>"sysop", "write"=>"sysop"])
  • $reason: Reason for protect
  • $moveonly: boolean whether it was for move only or not

See alsoEdit