MediaWiki REL1_35
MediaWiki\User\Hook\UserSaveOptionsHook Interface Reference

Stable to implement. More...

Inheritance diagram for MediaWiki\User\Hook\UserSaveOptionsHook:

Public Member Functions

 onUserSaveOptions ( $user, &$options, $originalOptions)
 This hook is called just before saving user preferences.
 

Detailed Description

Stable to implement.

Definition at line 11 of file UserSaveOptionsHook.php.

Member Function Documentation

◆ onUserSaveOptions()

MediaWiki\User\Hook\UserSaveOptionsHook::onUserSaveOptions (   $user,
$options,
  $originalOptions 
)

This hook is called just before saving user preferences.

Hook handlers can either add or manipulate options, or reset one back to its default to block changing it. Hook handlers are also allowed to abort the process by returning false, e.g. to save to a global profile instead. Compare to the UserSaveSettings hook, which is called after the preferences have been saved.

Since
1.35
Parameters
User$userThe User for which the options are going to be saved
array&$optionsThe user's options as an associative array, modifiable
array$originalOptionsThe user's original options being replaced
Returns
bool|void True or no return value to continue or false to abort

Implemented in MediaWiki\HookContainer\HookRunner.


The documentation for this interface was generated from the following file: