Manual:Hooks/SkinEditSectionLinks

From Linux Web Expert

SkinEditSectionLinks
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Modify the section edit links. Called when section headers are created.
<translate> Define function:</translate>
public static function onSkinEditSectionLinks( $skin, $title, $section, $tooltip, &$links, $lang ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"SkinEditSectionLinks": "MediaWiki\\Extension\\MyExtension\\Hooks::onSkinEditSectionLinks"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> Skin.php
<translate> Interface:</translate> SkinEditSectionLinksHook.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:SkinEditSectionLinks extensions</tvar>.</translate>


Details

  • $skin: Skin object rendering the UI
  • $title: Title object for the title being linked to (may not be the same as the page title, if the section is included from a template)
  • $section: The designation of the section being pointed to, to be included in the link, like "&section=$section"
  • $tooltip: The default tooltip. Escape before using. By default, this is wrapped in the 'editsectionhint' message.
  • &$links: Array containing all link detail arrays. Each link detail array should contain the following keys:
    • targetTitle - Target Title object
    • text - String for the text
    • attribs - Array of attributes
    • query - Array of query parameters to add to the URL
    • options - Array of options for Linker::link
  • $lang: The language code to use for the link in the wfMessage function