< Manual:Hooks
GetNewMessagesAlert | |
---|---|
Available from version 1.22.0 (Gerrit change 62317) Disable or modify the new messages alert before it is shown | |
Define function: | public static function onGetNewMessagesAlert( string &$newMessagesAlert, array $newtalks, User $user, OutputPage $out ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"GetNewMessagesAlert": "MyExtensionHooks::onGetNewMessagesAlert"
}
}
|
Called from: | File(s): Skin.php |
Interface: | GetNewMessagesAlertHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:GetNewMessagesAlert extensions.
Details
- &$newMessagesAlert - An empty string by default. If the user has new talk page messages, this should be populated with an alert message to that effect
- $newtalks - An empty array if the user has no new messages or an array containing links and revisions if there are new messages (See User::getNewMessageLinks)
- $user - The User object of the user who is loading the page
- $out - OutputPage object (to check what type of page the user is on)
See also
- Manual:Hooks/ArticleEditUpdateNewTalk - Affects whether "new talk" status is stored to the database/memcached.
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.