Manual:Hooks/SelfLinkBegin

SelfLinkBegin
Available from version 1.24.0
called when rendering a self link on a page
Define function:
public static function onSelfLinkBegin( Title $nt, &$html, &$trail, &$prefix, &$ret ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"SelfLinkBegin": "MediaWiki\\Extension\\MyExtension\\Hooks::onSelfLinkBegin"
	}
}
Called from: File(s): linker/Linker.php
Interface: SelfLinkBeginHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:SelfLinkBegin extensions.


Details

edit
  • Title $nt: the title object of the page
  • &$html: Link text
  • &$trail: Text after link
  • &$prefix: Text before link
  • &$ret: Self link text to be used if the hook returns false