user_uid_optional_load

Versions
6 – 7
user_uid_optional_load($uid = NULL)

Load either a specified or the current user account.

See also

user_load()

Parameters

$uid An optional user ID of the user to load. If not provided, the current user's ID will be used.

Return value

A fully-loaded $user object upon successful user load, FALSE if user cannot be loaded.

Code

modules/user/user.module, line 1138

<?php
function user_uid_optional_load($uid = NULL) {
  if (!isset($uid)) {
    $uid = $GLOBALS['user']->uid;
  }
  return user_load($uid);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.