Manual:Hooks/LinkEnd

From MediaWiki.org
Jump to: navigation, search
LinkEnd
Available from version 1.14.0
Used when generating internal and interwiki links in Linker::link(), just before the function returns a value.

*Define function:
function fnMyHook( $skin, Title $target, array $options, &$text, array &$attribs, &$ret ) { ... }

*Attach hook:
$wgHooks['LinkEnd'][] = 'MyExtensionHooks::someExample';
Called from: Linker.php

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


[edit] Details

If you return true, an <a> element with HTML attributes $attribs and contents $text will be returned. If you return false, $ret will be returned.

  • $skin: the Skin object. As of 1.18, this is a DummyLinker instead
  • $target: the Title object that the link is pointing to
  • $options: the options. Will always include either 'known' or 'broken', and may include 'noclasses'.
  • &$text: the final (raw HTML) contents of the <a> tag, after processing.
  • &$attribs: the final HTML attributes of the <a> tag, after processing, in associative array form.
  • &$ret: the value to return if your hook returns false.
Personal tools
Namespaces
Variants
Actions
Site
Support
Download
Development
Communication
Print/export
Toolbox