Manual:Hooks/ProtectionForm::save

From Linux Web Expert

ProtectionForm::save
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Called when a protection form is submitted.
<translate> Define function:</translate>
public static function onProtectionForm_save( $article, $errorMsg, $reasonstr ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ProtectionForm::save": "MediaWiki\\Extension\\MyExtension\\Hooks::onProtectionFormsave"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> ProtectionForm.php
<translate> Interface:</translate> ProtectionForm__saveHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:ProtectionForm::save extensions</tvar>.</translate>


Details

  • $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