Manual:Hooks/PersonalUrls
From MediaWiki.org
| PersonalUrls | |
|---|---|
| Available from version 1.7.0 (r14138) Called after the personal URLs have been set up, before they are shown. |
|
Define function: |
public static function onPersonalUrls( array &$personal_urls, Title $title ) { ... }
|
Attach hook: |
$wgHooks['PersonalUrls'][] = 'MyExtensionHooks::onPersonalUrls'; |
| Called from: | SkinTemplate.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:PersonalUrls extensions.
[edit] Details
- $personal_urls: the array of URLs set up so far
- $title: the Title object of the current article
[edit] 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) |
Only text and href are mandatory.
[edit] List of PersonalUrls
In a genuine MediaWiki install, the $personal_urls contains the following entries:
| Key | Description | Target page sample |
| userpage | The user page | User:John Doe |
| mytalk | The user talk page | User talk:John Doe |
| preferences | The preferences special page | Special:Preferences |
| watchlist | The user watchlist | Special:Watchlist |
| mycontris | The user contributions page | Special:Contributions/John Doe |
| logout | The logout page | Special:UserLogout |