Open main menu

Manual:Hooks/SkinTemplateGetLanguageLink

< Manual:Hooks
SkinTemplateGetLanguageLink
Available from version 1.23.0
Allows modification of the data that a language link will be constructed out of.
Define function:
public static function onSkinTemplateGetLanguageLink( &$languageLink, $languageLinkTitle, $title ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SkinTemplateGetLanguageLink": "MyExtensionHooks::onSkinTemplateGetLanguageLink"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SkinTemplateGetLanguageLink'][] = 'MyExtensionHooks::onSkinTemplateGetLanguageLink';
Called from:File(s): SkinTemplate.php

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

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

DetailsEdit

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

ArgumentsEdit

  • &$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