Manual:Hooks/BadImage

From MediaWiki.org
Jump to navigation Jump to search
BadImage
Available from version 1.7.0
Used to determine if an image exists on the 'bad image list'. Return false to when setting $bad value.
Define function:
public static function onBadImage( $name, &$bad ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"BadImage": "MyExtensionHooks::onBadImage"
	}
}

For MediaWiki ≤1.25:

$wgHooks['BadImage'][] = 'MyExtensionHooks::onBadImage';
Called from:File(s): GlobalFunctions.php

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

Details[edit]

Defined in ImageFunctions.php

  • $bad: true = image is on bad image list.
  • $name: String
  • return: false = evaluate bad image list, true = use $bad