Add SpecialBlockModifyFormFields hook
authorKunal Mehta <legoktm@gmail.com>
Thu, 12 Dec 2013 20:18:05 +0000 (12:18 -0800)
committerKunal Mehta <legoktm@gmail.com>
Mon, 16 Dec 2013 00:12:10 +0000 (16:12 -0800)
For extensions to add more fields to Special:Block

Change-Id: I00fbc7af1e50e1f76208a3692f152058d2d1879e

docs/hooks.txt
includes/specials/SpecialBlock.php

index de87963..53382f4 100644 (file)
@@ -2203,6 +2203,10 @@ software.
 $software: The array of software in format 'name' => 'version'. See
   SpecialVersion::softwareInformation().
 
+'SpecialBlockModifyFormFields': Add more fields to Special:Block
+$sp: SpecialPage object, for context
+&$fields: Current HTMLForm fields
+
 'SpecialContributionsBeforeMainOutput': Before the form on Special:Contributions
 $id: User identifier
 
index 3b73a37..fa5ec29 100644 (file)
@@ -221,6 +221,9 @@ class SpecialBlock extends FormSpecialPage {
 
                $this->maybeAlterFormDefaults( $a );
 
+               // Allow extensions to add more fields
+               wfRunHooks( 'SpecialBlockModifyFormFields', array( $this, &$a ) );
+
                return $a;
        }