Manual:Hooks/NormalizeMessageKey: Difference between revisions
Appearance
Content deleted Content added
mNo edit summary |
Ricordisamoa (talk | contribs) removed in 1.27.0, see gerrit:262333 |
||
| Line 2: | Line 2: | ||
|name=NormalizeMessageKey |
|name=NormalizeMessageKey |
||
|version=1.13.0 |
|version=1.13.0 |
||
|removed=1.27.0 |
|||
|args=&$key, &$useDB, &$langCode, &$transform |
|args=&$key, &$useDB, &$langCode, &$transform |
||
|source=GlobalFunctions.php |
|source=GlobalFunctions.php |
||
Revision as of 00:27, 14 February 2016
This feature was removed completely in version 1.27.0. |
| NormalizeMessageKey | |
|---|---|
| Available from version 1.13.0 Removed in version 1.27.0 Allows extensions to change what system message will be displayed on a page | |
| Define function: | public static function onNormalizeMessageKey( &$key, &$useDB, &$langCode, &$transform ) { ... }
|
| Attach hook: | In extension.json:
{
"Hooks": {
"NormalizeMessageKey": "MediaWiki\\Extension\\MyExtension\\Hooks::onNormalizeMessageKey"
}
}
|
| Called from: | File(s): GlobalFunctions.php |
| Interface: | NormalizeMessageKeyHook.php |
For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:NormalizeMessageKey extensions.
Details
- &$key: (string) The message going to be displayed. Change this to display a different message in its place
- &$useDB: (bool) Whether to query the database to get the message
- &$langCode: (string or bool) If a string, the language code that should be used to get the message, if bool true, uses the content language, if bool false, uses the site's default language
- &$transform: (bool) Whether to expand templates and variables in the message