Manual:Hooks/LocalFilePurgeThumbnails

From Linux Web Expert

LocalFilePurgeThumbnails
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Called before thumbnails for a local file are purged.
<translate> Define function:</translate>
public static function onLocalFilePurgeThumbnails( $file, $archiveName ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"LocalFilePurgeThumbnails": "MediaWiki\\Extension\\MyExtension\\Hooks::onLocalFilePurgeThumbnails"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> LocalFile.php
<translate> Interface:</translate> LocalFilePurgeThumbnailsHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:LocalFilePurgeThumbnails extensions</tvar>.</translate>


Details

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

See also