Manual:Hooks/GetPreferences/zh

例子
In :

In :



选项卡和节
数组键指定的哪个选项卡和部分包含您的首选项. 如果您的 值是foo/bar，这意味着您的首选项将出现在bar部分(由系统消息$pref-bar命名)的foo选项卡上(由系统消息 命名). 如果不存在这样的选项卡或部分，则会自动创建.



默认标签列表


Visible types
The type can take on various values found in the  array in the file, including  ,  ,  , etc.

Most preferences are stored in the same format as is used by the HTMLFormField, but in the case of  a transformation should be carried out from a newline-separated list of usernames (which is what the form widget works with) and a newline-separated list of user IDs (which is what gets stored in the database). See the treatment of  (in core) or   (in ) for examples of this.

Floats
For  types, you can set   and , which will be validated on save.



API参数设置
API preferences use type 'api'. They are not displayed in Special:Preferences.

Default preferences
To set the default value for a preference (i.e. the value that is set for a new user that hasn't customized their preferences yet), add the setting to the global variable. Use the same key name as you use for $preferences in the hook.

Alternatively, if you're writing an extension, you can add to the DefaultUserOptions section of the file extensions.json.