Manual:Hooks/EditSectionLink

Category:MediaWiki hooks#EditSectionLink Category:Hooks added in MediaWiki 1.11.0#EditSectionLink Category:MediaWiki deprecated or obsolete features#EditSectionLink Category:Hooks removed in MediaWiki 1.22.0#EditSectionLink Category:Hooks deprecated in MediaWiki 1.14.0#EditSectionLink
EditSectionLink
Available from version 1.11.0
Removed in version 1.22.0Category:Removed hooks#EditSectionLink
Override the return value of Linker::editSectionLink()
Define function:
public static function onEditSectionLink( $skin, $title, $section, $link, $result ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"EditSectionLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onEditSectionLink"
	}
}
Called from: File(s): Linker.phpCategory:MediaWiki hooks included in Linker.php#EditSectionLink
Interface: EditSectionLinkHook.php

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

Details

  • $skin: Skin rendering the UI
  • $title: Title being linked to
  • $section: Section to link to
  • $link: Default link
  • $result: Result (alter this to override the generated links)

Can be used to change, modify, add links on the right side of the section header. Also, there's a system message called editsection-brackets which allows you to customise the format of the edit links further to make them into images etc. The final result is wrapped in a span with class attribute set to "editsection" so that further CSS styles can be applied.

Category:Edit hooks
Category:Edit hooks Category:Hooks added in MediaWiki 1.11.0 Category:Hooks deprecated in MediaWiki 1.14.0 Category:Hooks removed in MediaWiki 1.22.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in Linker.php Category:Removed hooks