3 namespace MediaWiki\Linker\Hook
;
6 use MediaWiki\Linker\LinkRenderer
;
7 use MediaWiki\Linker\LinkTarget
;
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
16 interface HtmlPageLinkRendererBeginHook
{
18 * This hook is called when generating internal and interwiki links in
19 * LinkRenderer, before processing starts.
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
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
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