Manual:Hooks/PersonalUrls

Category:MediaWiki hooks#PersonalUrls Category:Hooks added in MediaWiki 1.7.0#PersonalUrls Category:MediaWiki deprecated or obsolete features#PersonalUrls Category:Hooks removed in MediaWiki 1.41.0#PersonalUrls Category:Hooks deprecated in MediaWiki 1.39.0#PersonalUrls
PersonalUrls
Available from version 1.7.0 (r14138, CodeReview archive)
Removed in version 1.41.0 (Gerrit change 959839)Category:Removed hooks#PersonalUrls
Called after the personal URLs have been set up, before they are shown.
Define function:
public static function onPersonalUrls( array &$personal_urls, Title $title, SkinTemplate $skin ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"PersonalUrls": "MediaWiki\\Extension\\MyExtension\\Hooks::onPersonalUrls"
	}
}
Called from: File(s): skins/SkinTemplate.phpCategory:MediaWiki hooks included in SkinTemplate.php#PersonalUrls
Interface: PersonalUrlsHook.php

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

Details

  • $personal_urls: the array of URLs set up so far
  • $title: the Title object of the current article
  • $skin: SkinTemplate object providing context (e.g. to check if the user is logged in, etc.) - since 1.23 (gerrit:95776)

personal_urls items format

Each line of the array is composed from an array, containing 4 items:
Key Description
text The link text
href The link URL
active Determines if this link is the active page
class Custom CSS class for the link (e.g. new if the page doesn't exist)
iconIcon identifier, for use in skins which support it, e.g. Vector (2022)

Only text and href are mandatory.

List of PersonalUrls

In a vanilla MediaWiki install, the $personal_urls contains the following entries:

Key Description Target page sample
userpage & anonuserpage The user pageUser:John Doe
mytalk & anontalk The user talk pageUser talk:John Doe
preferences The preferences special pageSpecial:Preferences
watchlist The user watchlistSpecial:Watchlist
mycontris The user contributions pageSpecial:Contributions/John Doe
logout The logout pageSpecial:UserLogout
createaccount The registration pageSpecial:Createaccount
login & anonlogin The login pageSpecial:UserLogin
Category:Hooks added in MediaWiki 1.7.0 Category:Hooks deprecated in MediaWiki 1.39.0 Category:Hooks removed in MediaWiki 1.41.0 Category:MediaWiki deprecated or obsolete features Category:MediaWiki hooks Category:MediaWiki hooks included in SkinTemplate.php Category:Removed hooks