< Manual:Hooks
| ImageBeforeProduceHTML | |
|---|---|
| Available from version 1.13.0 Called before producing the HTML created by a wiki image insertion | |
| Define function: | public static function onImageBeforeProduceHTML( DummyLinker &$linker, Title &$title, &$file, array &$frameParams, array &$handlerParams, &$time, &$result, Parser $parser, string &$query, &$widthOption ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"ImageBeforeProduceHTML": "MyExtensionHooks::onImageBeforeProduceHTML"
}
}
|
| Called from: | File(s): Linker.php Function(s): makeImageLink |
| Interface: | ImageBeforeProduceHTMLHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:ImageBeforeProduceHTML extensions.
Details
You can skip the default logic entirely by returning false, or just modify a few things using call-by-reference.
&$linker: DummyLinker object&$title: Title object of the image&$file: File object, or false if it doesn't exist&$frameParams: Various parameters with special meanings; see documentation in includes/Linker.php forLinker::makeImageLink&$handlerParams: Various parameters with special meanings; see documentation in includes/Linker.php forLinker::makeImageLink&$time: Timestamp of file inYYYYMMDDHHIISSstring form, or false for current&$result: Final HTML output (string, null by default), used if you return false$parser: Parser object (introduced in 1.32.0)&$query: Query params for desc URL (introduced in 1.32.0)&$widthOption: Used by the parser to remember the user preference thumbnail size. Int or null (introduced in 1.32.0)
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.