Manual:Hooks/UploadCreateFromRequest

From MediaWiki.org
Jump to navigation Jump to search
UploadCreateFromRequest
Available from version 1.16.0
When UploadBase::createFromRequest has been called
Define function:
public static function onUploadCreateFromRequest( $type, &$className ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UploadCreateFromRequest": "MyExtensionHooks::onUploadCreateFromRequest"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UploadCreateFromRequest'][] = 'MyExtensionHooks::onUploadCreateFromRequest';
Called from:File(s): UploadBase.php

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

Details[edit]

  • $type: string: the requested upload type
  • &$className: the class name of the Upload instance to be created