Manual:Hooks/BadImage

From Linux Web Expert

Revision as of 03:06, 29 June 2019 by imported>Shirayuki (fix)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

BadImage
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Used to determine if an image exists on the 'bad image list'. Return false to when setting $bad value.
<translate> Define function:</translate>
public static function onBadImage( $name, &$bad ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"BadImage": "MediaWiki\\Extension\\MyExtension\\Hooks::onBadImage"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> GlobalFunctions.php
<translate> Interface:</translate> BadImageHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:BadImage extensions</tvar>.</translate>

Details

Defined in ImageFunctions.php

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