Manual:$wgDefaultUserOptions/ja

関連項目: Manual:Hooks/GetPreferences

The below changes to LocalSettings.php will override the default user preferences for anonymous visitors and users who have not customized their preferences. Existing user accounts who had the (previous) default option and didn't set it explicitly (which means that it's not stored in the database) will then use the new default.

Note: in the old preferences system, the change affects only anonymous visitors (if relevant) and new accounts.

利用できる設定
The following user preferences are available for customization:

注:
 * 新しい設定は定期的にMediaWikiに追加されます. これらの設定の中には$wgDefaultUserOptionsが導入されたバージョン1.4.0以降に追加されたものがあります. 現在追加された設定に関してドキュメントは存在しません.
 * 追加の切り替えスイッチを'misc'(その他の)タブに追加することはエクステンションと言語コードで可能です. この機能を使う言語はここで説明された設定を持つべきです. エクステンションは情報をそれらのエクステンションページに追加します.
 * This list is not up to date with the latest MediaWiki Version. List options with --list.

ガジェットのオプション
gadget-$gname e.g. gadget-HotCat for MediaWiki:Gadget-HotCat.js

デフォルト値
Each language sets its own default values for the user preferences in its language file. For example languages that read right-to-left will probably set the quickbar to appear on the right, instead of on the left. The values added to $wgDefaultUserOptions are overrides, i.e. if the value exists here then it will take precedence, but settings may be omitted from the array in which case the language's default value will be used.

In versions of MediaWiki prior to 1.8.0 the default value of this setting was simply an empty array, with the current language providing the default values.

From version 1.8.0 onwards, only the language-specific settings were overridden in the language file, so most settings are now explicitly set in.

From version 1.19, the overrides by the language files were removed because they didn't work, and the features that used them, like quickbar, have been done differently and better.

例
(新規ユーザと匿名ユーザに対して)デフォルトでセクション編集リンクを無効にするために、LocalSettings.phpで次の設定を行って下さい:

Add pages the user edits to their watchlist by default:

If the preference is of type multiselect, things are a bit more complicated. The key for each default user option is the concatenation of the preference key with the option key. For example if the preference key is 'favoritecolors' and the option key is 'red', the default user option key would be 'favoritecolorsred'. In this hypothetical scenario, if you wanted to have red and yellow selected by default, you would use:

If the preference is of type checkmatrix, things are even more complicated. The key for each default user option is the concatenation of the preference key with the column key and row key, separated with hyphens. For example if the preference key is 'favoritecars' and the column key is 'red' and the row key is 'corvette', the default user option key would be 'favoritecars-red-corvette'. In this hypothetical scenario, if you wanted to have red Corvette and black Jetta selected by default, you would use:

関連項目

 * userOptions.php - Changing the user options of existing users
 * $wgNamespacesToBeSearchedDefault
 * $wgHiddenPrefs