function user_uid_optional_to_arg
Same name and namespace in other branches
- 6.x drupal-6.x/modules/user/user.module \user_uid_optional_to_arg()
Returns $arg or the user ID of the current user if $arg is '%' or empty.
@todo rethink the naming of this in Drupal 8.
1 call to user_uid_optional_to_arg()
- user_uid_only_optional_to_arg in drupal-7.x/
modules/ user/ user.module - Returns $arg or the user ID of the current user if $arg is '%' or empty.
Archivo
- drupal-7.x/
modules/ user/ user.module, line 1995 - Enables the user registration and login system.
Código
function user_uid_optional_to_arg($arg) {
// Give back the current user uid when called from eg. tracker, aka.
// with an empty arg. Also use the current user uid when called from
// the menu with a % for the current account link.
return empty($arg) || $arg == '%' ? $GLOBALS['user']->uid : $arg;
}