Jump to content

Manual:Hooks/ProtectionForm::save

From mediawiki.org
ProtectionForm::save
Available from version 1.16.0
Called when a protection form is submitted.
Define function:
public static function onProtectionForm_save( $article, $errorMsg, $reasonstr ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ProtectionForm::save": "MediaWiki\\Extension\\MyExtension\\Hooks::onProtectionFormsave"
	}
}
Called from: File(s): ProtectionForm.php
Interface: ProtectionForm__saveHook.php

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


Details

[edit]
  • $article: the title being (un)protected
  • $errorMsg: an html message string of an error
  • $reasonstr: (since git #I879290e) the reason the user gave for the change