Manual:Hooks/UserToggles
From MediaWiki.org
|
|
This feature has been deprecated and should not be used with current versions of MediaWiki. This feature was deprecated (or possibly removed completely) in version 1.16.0. |
| UserToggles | |
|---|---|
| Available from version 1.8.0 Removed in version 1.16.0 Provides an opportunity to dynamically add user toggles |
|
*Define function: |
function fnMyHook( &$extraToggles ) { ... }
|
*Attach hook: |
$wgHooks['UserToggles'][] = 'MyExtensionHooks::someExample'; |
| Called from: | User.php |
*For more information about attaching hooks, see Manual:Hooks.
*For examples of extensions using this hook, see Category:UserToggles extensions.
[edit] Background
The MediaWiki special page Special:Preferences contains a number of checkboxes. The values for these check boxes come from two sources:
- a list of hard coded toggles defined in User.php
- toggles added dynamically via the
UserToggleshook.
[edit] Details
Implementers add their dynamically generated toggles by adding elements to $extraToggles. The array consists of a list of system messages, each of which identifies the user toggle and its accompanying localized check box message.
This hook is now deprecated. Please use Hooks/GetPreferences instead