Manual:User preferences

......

Retrieving user preferences
To retrieve all of a user's preferences, use UserOptionsLookup::getOptions with a user identity object as a parameter.

To retrieve a specific preference of a user, use UserOptionsLookup::getOption with a user identity and the name of the preference as a parameter, for example:

If the preference is of the multiselect or checkmatrix type, the parameter will be &lt;preference-name>&lt;option-value>. For example, if the preference name is ' searchNs ' and the option value is ' 2 ', the parameter for getOption will be ' searchNs2 '. There is an exception to this, however: If the preference specifies an explicit option prefix, that prefix will be used instead of the preference name (&lt;prefix-name>&lt;option-name>). See the Gadgets extension for an example.

To retrieve it in JavaScript, use the module.

Setting default preferences
For information about how to set default preferences for all users, see.

Changing a preference
Preferences can be changed through the API action.

Creating a preferences interface
For information about creating a preferences interface for your features, see.

Gadget and user script preferences
Any gadget or user script can define a preference, the name of which must start with " ". Such a preference will not appear in Special:Preferences or in responses, and it will not be validated. It can be read from, and set through.

Hidden API preferences
API preferences are also defined through the GetPreferences hook, with the type set to. They are validated and readable the normal ways, but are not part of the Special:Preferences form.