Manual:Hooks/ProtectionFormAddFormFields

From Linux Web Expert

ProtectionFormAddFormFields
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 581878)</tvar></translate>
This hook is called after all protection type form fields are added.
<translate> Define function:</translate>
public static function onProtectionFormAddFormFields( Article $article, array &$hookFormOptions ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"ProtectionFormAddFormFields": "MediaWiki\\Extension\\MyExtension\\Hooks::onProtectionFormAddFormFields"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> ProtectionForm.php
<translate> Function(s):</translate> buildForm
<translate> Interface:</translate> ProtectionFormAddFormFieldsHook.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:ProtectionFormAddFormFields extensions</tvar>.</translate>


Parameters

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

Notes