Jump to content

Manual:Hooks/GetMetadataVersion

From mediawiki.org
GetMetadataVersion
Available from version 1.18.0 (r86169, codereview)
Allows to modify the image metadata version currently in use.
Define function:
public static function onGetMetadataVersion( &$version ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"GetMetadataVersion": "MediaWiki\\Extension\\MyExtension\\Hooks::onGetMetadataVersion"
	}
}
Called from: File(s): media/MediaHandler.php
Interface: GetMetadataVersionHook.php

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


Details

[edit]

This is used when requesting image metadata from a ForiegnApiRepo. Media handlers that need to have versioned metadata should add an element to the end of the version array of the form 'handler_name=version'. Most media handlers won't need to do this unless they broke backwards compatibility with a previous version of the media handler metadata output.

  • &$version: Array of version strings