Manual:Hooks/ArticleProtect
From MediaWiki.org
| ArticleProtect | |
|---|---|
| Available from version 1.4.0 Occurs whenever the software receives a request to protect an article |
|
*Define function: |
function fnMyHook( &$article, &$user, $protect, $reason, $moveonly ) { ... }
|
*Attach hook: |
$wgHooks['ArticleProtect'][] = 'fnMyHook'; |
| Called from: | Article.php |
*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:ArticleProtect extensions.
[edit] Details
- $article: (object) the article being protected
- $user: (object) the user doing the protection
- $protect*: boolean flag indicating whether the request is protect or unprotect
- $reason: (string) Reason for protect
- $moveonly: (boolean) flag indicating whether this is for move only or not
* prior to version 1.10, this field stored an array of restrictions that were stored in the page_restrictions field of the page table.