Manual:Hooks/UserLogout

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": "MediaWiki\\Extension\\MyExtension\\Hooks::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

edit
  • $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

edit