Manual:Hooks/UserSaveOptions

From MediaWiki.org
Jump to: navigation, search
UserSaveOptions
Available from version 1.16.0
Called just before saving user preferences/options.
Define function:
public static function onUserSaveOptions( User $user, array &$options ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserSaveOptions": [
			"MyExtensionHooks::onUserSaveOptions"
		]
	}
}

For MediaWiki ≤1.25:

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

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

Details[edit]

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

See also[edit]