Manual:Hooks/FileDeleteComplete

From MediaWiki.org
Jump to: navigation, search
FileDeleteComplete
Available from version 1.13.0
When a file is deleted
Define function:
public static function onFileDeleteComplete( $file, $oldimage, $article, $user, $reason ) { ... }
Attach hook:
$wgHooks['FileDeleteComplete'][] = 'MyExtensionHooks::onFileDeleteComplete';
Called from: File(s): FileDeleteForm.php

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

Details[edit]

  • $file: reference to the deleted file
  • $oldimage: in case of the deletion of an old image, the name of the old file
  • $article: in case all revisions of the file are deleted a reference to the article associated with the file.
  • $user: user who performed the deletion
  • $reason: reason