Jump to content

Manual:Hooks/SkinEditSectionLinks

From mediawiki.org
SkinEditSectionLinks
Available from version 1.25.0
Modify the section edit links. Called when section headers are created.
Define function:
public static function onSkinEditSectionLinks( $skin, $title, $section, $tooltip, &$links, $lang ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"SkinEditSectionLinks": "MediaWiki\\Extension\\MyExtension\\Hooks::onSkinEditSectionLinks"
	}
}
Called from: File(s): Skin.php
Interface: SkinEditSectionLinksHook.php

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


Details

[edit]
  • $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