Manual:Hooks/UploadForm:BeforeProcessing

From MediaWiki.org

Jump to: navigation, search
This feature has been deprecated and should not be used with current versions of MediaWiki.

This feature was deprecated (or possibly removed completely) in version 1.16.0.

UploadForm:BeforeProcessing
Available from version 1.9.0
Removed in version 1.16.0
Called just before the upload data, like wpUploadDescription, are processed, so extensions get a chance to manipulate them.

*Define function:
function fnMyHook( $uploadFormObj ) { ... }

*Attach hook:
$wgHooks['UploadForm:BeforeProcessing'][] = 'fnMyHook';
Called from: SpecialUpload.php

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


[edit] Details

  • $uploadFormObj: current UploadForm object

The hook function must return true (or at least something which doesn't evaluate as false). Otherwise, nothing happens, without any message to the user (unless the hook function itself takes care of that).