Manual:Hooks/ResetPreferences

From MediaWiki.org
Jump to navigation Jump to search
ResetPreferences
Available from version 1.11.0
Removed in version 1.16.0
called at the end of PreferencesForm::resetPrefs()
Define function:
public static function onResetPreferences( $form, $user ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"ResetPreferences": "MyExtensionHooks::onResetPreferences"
	}
}

For MediaWiki ≤1.25:

$wgHooks['ResetPreferences'][] = 'MyExtensionHooks::onResetPreferences';
Called from:File(s): SpecialPreferences.php

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

Details[edit]

  • $form: the PreferencesForm
  • $user: the User object to load preferences from