Manual:Hooks/UserLoadOptions

From Linux Web Expert

UserLoadOptions
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 723014)</tvar></translate>
When user options/preferences are being loaded from the database.
<translate> Define function:</translate>
public static function onUserLoadOptions( User $user, &$options ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"UserLoadOptions": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserLoadOptions"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> User.php
<translate> Interface:</translate> UserLoadOptionsHook.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:UserLoadOptions extensions</tvar>.</translate>

Details

  • $user: User object
  • &$options: Options, can be modified.

See also