< Manual:Hooks
UserLogout
Available from version 1.4.0
Occurs when the software receives a request to log out
Define function:
public static function onUserLogout( &$user ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"UserLogout": "MyExtensionHooks::onUserLogout"
	}
}
Called from: File(s): specials/SpecialUserLogout.php
Interface: UserLogoutHook.php

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

Details

  • $user: the user object that is about to be logged out
  • The function called must return true/false, otherwise a MWException is thrown.

See also

  • UserLogoutComplete
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.