Manual:Hooks/DoEditSectionLink
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed from MediaWiki core in version <tvar name=ver>1.32.0</tvar> (after being deprecated in <tvar name=4>1.25.0</tvar>).</translate> <translate> Please see <tvar name=page>SkinEditSectionLinks</tvar> for an alternative way to use this feature.</translate> |
DoEditSectionLink | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate> <translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 465783)</tvar></translate> Override the HTML generated for section edit links. | |
<translate> Define function:</translate> | public static function onDoEditSectionLink( $skin, $title, $section, $tooltip, &$result, $lang ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"DoEditSectionLink": "MediaWiki\\Extension\\MyExtension\\Hooks::onDoEditSectionLink"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> Skin.php <translate> Function(s):</translate> doEditSectionLink |
<translate> Interface:</translate> | DoEditSectionLinkHook.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:DoEditSectionLink 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
$wgTitle
, if the section is included from a template) - $section: The designation of the section being pointed to, to be included in the link, like
§ion=$section
- $tooltip: The default tooltip. Escape with
htmlspecialchars()
before using. By default, this is wrapped in the editsectionhint message. (NOTE: This i18n message is no longer necessary.) - $result: The HTML to return, pre-filled with the default plus whatever other changes earlier hooks have made
- $lang: Language code in which the link should be provided.