Merge "Fix for "Add explicit GENDER support to a few pages" Issue"
[mediawiki.git] / includes / linker / Hook / HtmlPageLinkRendererBeginHook.php
blob2d3519c7591a23cf75e2113ff4ecbbbd7871e79a
1 <?php
3 namespace MediaWiki\Linker\Hook;
5 use HtmlArmor;
6 use MediaWiki\Linker\LinkRenderer;
7 use MediaWiki\Linker\LinkTarget;
9 /**
10 * This is a hook handler interface, see docs/Hooks.md.
11 * Use the hook name "HtmlPageLinkRendererBegin" to register handlers implementing this interface.
13 * @stable to implement
14 * @ingroup Hooks
16 interface HtmlPageLinkRendererBeginHook {
17 /**
18 * This hook is called when generating internal and interwiki links in
19 * LinkRenderer, before processing starts.
21 * @since 1.35
23 * @param LinkRenderer $linkRenderer
24 * @param LinkTarget $target LinkTarget that the link is pointing to
25 * @param string|HtmlArmor|null &$text Contents that the `<a>` tag should
26 * have; either a plain, unescaped string or an HtmlArmor object; null
27 * means "default"
28 * @param string[] &$customAttribs HTML attributes that the `<a>` tag should have, in
29 * associative array form, with keys and values unescaped. Should be merged
30 * with default values, with a value of false meaning to suppress the
31 * attribute.
32 * @param string[] &$query Query string to add to the generated URL (the bit after the "?"),
33 * in associative array form, with keys and values unescaped.
34 * @param string &$ret Value to return if your hook returns false
35 * @return bool|void True or no return value to continue, or false to skip default
36 * processing and return $ret
38 public function onHtmlPageLinkRendererBegin( $linkRenderer, $target, &$text,
39 &$customAttribs, &$query, &$ret