Available from version 1.23.0 (Gerrit change 78926)
Called to validate the cached metadata in FormatMetadata::getExtendedMeta (return false means cache will be invalidated and the GetExtendedMetadata hook will called again).
Define function:
public static function onValidateExtendedMetadataCache( $timestamp, File $file ) { ... }
Attach hook:

In extension.json:

	"Hooks": {
		"ValidateExtendedMetadataCache": "MyExtensionHooks::onValidateExtendedMetadataCache"

For MediaWiki ≤1.25:

$wgHooks['ValidateExtendedMetadataCache'][] = 'MyExtensionHooks::onValidateExtendedMetadataCache';
Called from:File(s): media/FormatMetadata.php
Function(s): fetchExtendedMetadata

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


  • $timestamp: The timestamp metadata was generated
  • $file: The file the metadata is for