Available from version 1.19.0
Called before thumbnails for a local file a purged.
Define function:
public static function onLocalFilePurgeThumbnails( $file, $archiveName ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"LocalFilePurgeThumbnails": "MyExtensionHooks::onLocalFilePurgeThumbnails"

For MediaWiki ≤1.25:

$wgHooks['LocalFilePurgeThumbnails'][] = 'MyExtensionHooks::onLocalFilePurgeThumbnails';
Called from:File(s): LocalFile.php

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


  • $file: the File object
  • $archiveName: name of an old file version or false if it's the current one

See alsoEdit