Manual:Hooks/UploadFormInitDescriptor

From MediaWiki.org
Jump to navigation Jump to search
UploadFormInitDescriptor
Available from version 1.16.0
Occurs after the descriptor for the upload form as been assembled.
Define function:
public static function onUploadFormInitDescriptor( $descriptor ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UploadFormInitDescriptor": "MyExtensionHooks::onUploadFormInitDescriptor"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UploadFormInitDescriptor'][] = 'MyExtensionHooks::onUploadFormInitDescriptor';
Called from: File(s): SpecialUpload.php

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

Details[edit]

  • $descriptor: the HTMLForm descriptor