Manual:Hooks/UserLoadOptions

From MediaWiki.org
Jump to navigation Jump to search
UserLoadOptions
Available from version 1.16.0
When user options/preferences are being loaded from the database.
Define function:
public static function onUserLoadOptions( $user, &$options ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserLoadOptions": "MyExtensionHooks::onUserLoadOptions"
	}
}

For MediaWiki ≤1.25:

$wgHooks['UserLoadOptions'][] = 'MyExtensionHooks::onUserLoadOptions';
Called from: File(s): User.php

For more information about attaching hooks, see Manual:Hooks.
For examples of extensions using this hook, see Category:UserLoadOptions extensions.

Details[edit]

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

See also[edit]