Open main menu


Available from version 1.13.0
When a file is undeleted
Define function:
public static function onFileUndeleteComplete( $title, $fileVersions, $user, $reason ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"FileUndeleteComplete": "MyExtensionHooks::onFileUndeleteComplete"

For MediaWiki ≤1.25:

$wgHooks['FileUndeleteComplete'][] = 'MyExtensionHooks::onFileUndeleteComplete';
Called from:File(s): specials/SpecialUndelete.php

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


  • $title: title object to the file
  • $fileVersions: array of undeleted versions. Empty if all versions were restored
  • $user: user who performed the undeletion
  • $reason: reason