aboutsummaryrefslogtreecommitdiffstats
path: root/includes/parser/Hook/ParserMakeImageParamsHook.php
blob: f48825410edb02b8022de547252805a9ac916944 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php

namespace MediaWiki\Hook;

use MediaWiki\FileRepo\File\File;
use MediaWiki\Parser\Parser;
use MediaWiki\Title\Title;

/**
 * This is a hook handler interface, see docs/Hooks.md.
 * Use the hook name "ParserMakeImageParams" to register handlers implementing this interface.
 *
 * @stable to implement
 * @ingroup Hooks
 */
interface ParserMakeImageParamsHook {
	/**
	 * This hook is called before the parser generates an image link, use this
	 * to modify the parameters of the image.
	 *
	 * @since 1.35
	 *
	 * @param Title $title Title object representing the file
	 * @param File $file File object that will be used to create the image
	 * @param array &$params Two-dimensional array of parameters
	 * @param Parser $parser Parser object that called the hook
	 * @return bool|void True or no return value to continue or false to abort
	 */
	public function onParserMakeImageParams( $title, $file, &$params, $parser );
}