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"
	}
}
Called from:File(s): media/FormatMetadata.php
Interface:GetExtendedMetadataHook.php

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