Manual:Hooks/SkinAddFooterLinks
Jump to navigation
Jump to search
SkinAddFooterLinks | |
---|---|
Available from version 1.35.0 Add items to the footer for skins using SkinAddFooterLinks | |
Define function: | public static function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerlinks ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"SkinAddFooterLinks": "MyExtensionHooks::onSkinAddFooterLinks"
}
}
|
Called from: | File(s): SkinTemplate.php |
Interface: | SkinAddFooterLinksHook.php |
For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:SkinAddFooterLinks extensions.
Details[edit]
This hook allows alteration of the footer.
Parameters:
- $skin: the Skin object
- $key: the current key for the current group (row) of footer links. Currently either
info
orplaces
. - &$footerItems: the array of links that can be changed. Keys will be used for generating the ID of the footer item; values should be HTML strings.
[edit]
info
:lastmod
: timestamp of last modification of the current page (only when$wgMaxCredits
is set)numberofwatchingusers
: obsolete(?)credits
: list of contributors to the current page (only when$wgMaxCredits
is set)copyright
: copyright information (see$wgRightsText
and related settings)
places
:privacy
: privacy policy (shows text from MediaWiki:Privacy, links to the page set in MediaWiki:Privacypage)about
: about page (shows text from MediaWiki:Aboutsite, links to the page set in MediaWiki:Aboutpage)disclaimer
: disclaimers page (shows text from MediaWiki:Disclaimers, links to the page set in MediaWiki:Disclaimerpage)
Setting a text-generating message for one of the places
items to -
removes that item from the footer.
Examples[edit]
// Add a link to the page "Test Page" with the text "Test", allowing modification by wiki administrators
// test-desc and test-page are i18n messages with the text of the link and the name of the page, respectively
public static function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerlinks ) {
if ( $key === 'places' ) {
$footerlinks['test'] = $skin->footerLink( 'test-desc', 'test-page' );
}
}
// Add an external link
public static function onSkinAddFooterLinks( Skin $skin, string $key, array &$footerlinks ) {
if ( $key === 'places' ) {
$footerlinks['my_url'] = Html::rawElement( 'a', [ 'href' => 'https://my.url/' ], 'My URL' );
}
}