| LinkerMakeExternalImage | |
|---|---|
| Available fromversion 1.13.0 Called before the HTML forexternal images is returned, used for modifying external image HTML | |
| Define function: | publicstaticfunctiononLinkerMakeExternalImage(&$url,&$alt,&$img){...} |
| Attach hook: | Inextension.json:{"Hooks":{"LinkerMakeExternalImage":"MediaWiki\\Extension\\MyExtension\\Hooks::onLinkerMakeExternalImage"}} |
| Called from: | File(s):Linker.php |
| Interface: | LinkerMakeExternalImageHook.php |
For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:LinkerMakeExternalImage extensions.
You need to returnfalse if you want to modify the HTML of external images, returning true will produce the normal external image HTML, regardless of if $img is set to something. Please note that you will need to include all parts of the HTML in $img, including the <img> tag, if you choose to return false.