Manual:Hooks/SkinTemplateTabAction

From MediaWiki.org
Jump to navigation Jump to search
SkinTemplateTabAction
Available from version 1.12.0
Override SkinTemplate::tabAction().
Define function:
public static function onSkinTemplateTabAction( &$sktemplate, $title, $message, $selected, $checkEdit, &$classes, &$query, &$text, &$result ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"SkinTemplateTabAction": "MyExtensionHooks::onSkinTemplateTabAction"
	}
}

For MediaWiki ≤1.25:

$wgHooks['SkinTemplateTabAction'][] = 'MyExtensionHooks::onSkinTemplateTabAction';
Called from:File(s): SkinTemplate.php

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

Details[edit]

You can either create your own array, or alter the parameters for the normal one.

  • &$sktemplate: The SkinTemplate instance.
  • $title: Title instance for the page.
  • $message: Visible label of tab.
  • $selected: Whether this is a selected tab.
  • $checkEdit: Whether or not the action=edit query should be added if appropriate.
  • &$classes: Array of CSS classes to apply.
  • &$query: Query string to add to link.
  • &$text: Link text.
  • &$result: Complete assoc. array if you want to return true.