Available from version 1.10.1
Allows an extension to modify an image gallery before it is rendered.
Define function:
public static function onBeforeParserrenderImageGallery( Parser $parser, $imageGallery ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"BeforeParserrenderImageGallery": "MyExtensionHooks::onBeforeParserrenderImageGallery"

For MediaWiki ≤1.25:

$wgHooks['BeforeParserrenderImageGallery'][] = 'MyExtensionHooks::onBeforeParserrenderImageGallery';
Called from:File(s): parser/Parser.php

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


  • $parser - The parser object
  • $imageGallery - The gallery that is about to be rendered