Jump to content

Manual:Hooks/BrokenLink

From mediawiki.org
BrokenLink
Available from version 1.13.0
Removed in version 1.14.0
Before the HTML is created for a broken (i.e. red) link
Define function:
public static function onBrokenLink( &$linker, $nt, $query, &$u, &$style, &$prefix, &$text, &$inside, &$trail ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"BrokenLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onBrokenLink"
	}
}
Called from: File(s): Linker.php
Interface: BrokenLinkHook.php

For more information about attaching hooks, see Manual:Hooks .

Details

[edit]
  • &$linker: Linker instance
  • $nt: the page title
  • $query: the URL query string passed in
  • &$u: the URL of this link
  • &$style: the inline CSS style
  • &$prefix: a prefix prepended to the linked text
  • &$text: the text placed by the user in the wiki-link
  • &$inside: any additional alphanumeric characters placed after the wiki-link, that are made part of the link text
  • &$trail: text placed immediately after the HTML link