WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

WPMU Functions/get user details


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php. Use any of these functions instead.

Description

Returns information relating to the user specified by the given username.

Replace With

Parameters

$username
(string) (required) Username of the user to be queried.
Default: None

Return Values

(object) 
Returns an object representing the the user in question. Details are represented in the following public variables:.
ID 
(integer) ID of the user in question.
user_login 
(string) Username (login) of the account in question.
user_pass 
(string) Password hash for the account in question.
user_nicename 
(string) Nickname set for the account in question.
user_email 
(string) Email address for the account in question (listed in Contact Info -> E-Mail).
user_url 
(string) Website for the account in question (listed in Contact Info -> Website).
user_registered 
(string) Date and time the account in question was registered.
user_activation_key 
(string) Key used to activate the account in question.
user_status 
(integer) Current status of the account in question.
display_name 
(string) Option chosen to be displayed for the account in question.
span 
(integer) Flag indicating if this account is marked as spam.
deleted 
(integer) Flag indicating if this account has been marked as deleted.

Usage

<?php get_user_details'admin' ); ?> <?php get_user_details'admin' )->user_nicename?>

Examples

<?php
$user_name 
'admin';
$user get_user_details$user_name );
echo 
'User '.$user_name.' has ID '.$user->ID;
?>

<?php
$user_name 
'admin';
echo 
'User '.$user_name.' has ID '.get_user_details$user_name )->ID;
?>

Change Log