Manual:Hooks/GetExtendedMetadata

From MediaWiki.org
Jump to navigation Jump to search
GetExtendedMetadata
Available from version 1.23.0 (Gerrit change 78926)
Allows including additional file metadata information in the extmetadata field of the imageinfo API
Define function:
public static function onGetExtendedMetadata( array &$combinedMeta, File $file, RequestContext $context, bool $single, int &$maxCacheTime ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"GetExtendedMetadata": "MyExtensionHooks::onGetExtendedMetadata"
	}
}

For MediaWiki ≤1.25:

$wgHooks['GetExtendedMetadata'][] = 'MyExtensionHooks::onGetExtendedMetadata';
Called from:File(s): media/FormatMetadata.php

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