Manual:Hooks/SelfLinkBegin

From Linux Web Expert

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

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:SelfLinkBegin extensions</tvar>.</translate>


Details

  • 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