Jump to content

Manual:Hooks/ThumbnailBeforeProduceHTML

From mediawiki.org
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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.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

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