Available from version 1.21.0
Called before an image HTML is about to be rendered (by ThumbnailImage:toHtml method).
Define function:
public static function onThumbnailBeforeProduceHTML( ThumbnailImage $thumbnail, array &$attribs, array &$linkAttribs ) { ... }
Attach hook: In extension.json:
	"Hooks": {
		"ThumbnailBeforeProduceHTML": "MediaWiki\\Extension\\MyExtension\\Hooks::onThumbnailBeforeProduceHTML"
Called from: File(s): media/ThumbnailImage.php
Interface: ThumbnailBeforeProduceHTMLHook.php

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

Details edit

  • $thumbnail: the ThumbnailImage object
  • &$attribs: image attribute array
  • &$linkAttribs: image link attribute array