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": "MyExtensionHooks::onProtectionFormsave"

For MediaWiki ≤1.25:

$wgHooks['ProtectionForm::save'][] = 'MyExtensionHooks::onProtectionFormsave';
Called from:File(s): ProtectionForm.php

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


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