Jump to content

Manual:Hooks/ProtectionFormAddFormFields

From mediawiki.org
ProtectionFormAddFormFields
Available from version 1.36.0 (Gerrit change 581878)
This hook is called after all protection type form fields are added.
Define function:
public static function onProtectionFormAddFormFields( Article $article, array &$hookFormOptions ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"ProtectionFormAddFormFields": "MediaWiki\\Extension\\MyExtension\\Hooks::onProtectionFormAddFormFields"
	}
}
Called from: File(s): ProtectionForm.php
Function(s): buildForm
Interface: ProtectionFormAddFormFieldsHook.php

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


Parameters

[edit]
  • $article: The title being (un)protected
  • &$hookFormOptions An array to add form fields to

Notes

[edit]