Manual:Hooks/UserLoadFromDatabase

From MediaWiki.org
Jump to navigation Jump to search
UserLoadFromDatabase
Available from version 1.15.0
Called when loading a user from the database.
Define function:
public static function onUserLoadFromDatabase( $user, &$s ) { ... }
Attach hook:

In extension.json:

{
	"Hooks": {
		"UserLoadFromDatabase": "MyExtensionHooks::onUserLoadFromDatabase"
	}
}
Called from:File(s): User.php
Interface:UserLoadFromDatabaseHook.php

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

Details[edit]

  • $user: user object
  • &$s: database query object