Manual:Hooks/ThumbnailBeforeProduceHTML

Category:MediaWiki hooks#ThumbnailBeforeProduceHTML Category:Hooks added in MediaWiki 1.21.0#ThumbnailBeforeProduceHTML
ThumbnailBeforeProduceHTML
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.phpCategory:MediaWiki hooks included in ThumbnailImage.php#ThumbnailBeforeProduceHTML
Interface: ThumbnailBeforeProduceHTMLHook.php

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

Details

  • $thumbnail: the ThumbnailImage object
  • &$attribs: image attribute array
  • &$linkAttribs: image link attribute array
Category:Hooks added in MediaWiki 1.21.0 Category:MediaWiki hooks Category:MediaWiki hooks included in ThumbnailImage.php