Manual:Hooks/UserResetAllOptions
From Linux Web Expert
File:OOjs UI icon alert-destructive.svg | <translate> This feature was removed completely in version <tvar name=ver>1.38.0</tvar> (after being deprecated in <tvar name=4>1.37.0</tvar>).</translate> |
UserResetAllOptions | |
---|---|
<translate> Available from <tvar name=1><translate> version <tvar (Gerrit change 144689)</tvar></translate> <translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 723014)</tvar></translate> Allows changing the behavior when a user's preferences are reset. For instance, certain preferences can be preserved. | |
<translate> Define function:</translate> | public static function onUserResetAllOptions( User $user, array &$newOptions, array $oldOptions, $resetKinds ] ); ) { ... }
|
<translate> Attach hook:</translate> | <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
"Hooks": {
"UserResetAllOptions": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserResetAllOptions"
}
}
|
<translate> Called from:</translate> | <translate> File(s):</translate> User.php <translate> Function(s):</translate> User::resetOptions |
<translate> Interface:</translate> | UserResetAllOptionsHook.php |
<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:UserResetAllOptions extensions</tvar>.</translate>
Details
User $user
: User whose preferences are being reset.array &$newOptions
: New preferences as associative array.array $oldOptions
: Old preferences as associative array.array|string resetKinds
: Kinds of preferences to reset as an array or string; seeUser::resetOptions
for possible values.