Manual:Hooks/SkinTemplateGetLanguageLink

From Linux Web Expert

SkinTemplateGetLanguageLink
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Allows modification of the data that a language link will be constructed out of.
<translate> Define function:</translate>
public static function onSkinTemplateGetLanguageLink( &$languageLink, $languageLinkTitle, $title ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SkinTemplateGetLanguageLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onSkinTemplateGetLanguageLink"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> SkinTemplate.php
<translate> Interface:</translate> SkinTemplateGetLanguageLinkHook.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:SkinTemplateGetLanguageLink extensions</tvar>.</translate>


Allows modification of the data that a language link will be constructed out of.

Details

Called after building the data for a language link from which the actual html is constructed.

Arguments

  • &$languageLink: array containing data about the link. The following keys can be modified: href, text, title, class, lang, hreflang. Each of them is a string.
  • $languageLinkTitle: Title object belonging to the external language link
  • $title: Title object of the page the link belongs to