| LinkerMakeMediaLinkFile | |
|---|---|
| Available fromversion 1.23.0 Called before the HTML for media link is returned, used for modifying media link HTML | |
| Define function: | publicstaticfunctiononLinkerMakeMediaLinkFile($title,$file,&$html,&$attribs,&$ret){...} |
| Attach hook: | Inextension.json:{"Hooks":{"LinkerMakeMediaLinkFile":"MediaWiki\\Extension\\MyExtension\\Hooks::onLinkerMakeMediaLinkFile"}} |
| Called from: | File(s):Linker.php |
| Interface: | LinkerMakeMediaLinkFileHook.php |
For more information about attaching hooks, seeManual:Hooks.
For examples of extensions using this hook, seeCategory:LinkerMakeMediaLinkFile extensions.
You need to returnfalse if you want to modify the HTML of media links, returningtrue will produce the normal media link HTML, regardless of if$ret is set to something. Please note that you will need to include all parts of the HTML in$ret, including the<a> tag, if you choose to returnfalse.