Manual:Hooks/UserLogout

From Linux Web Expert

UserLogout
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
Occurs when the software receives a request to log out
<translate> Define function:</translate>
public static function onUserLogout( &$user ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"UserLogout": "MediaWiki\\Extension\\MyExtension\\Hooks::onUserLogout"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> specials/SpecialUserLogout.php
<translate> Interface:</translate> UserLogoutHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:UserLogout extensions</tvar>.</translate>

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