wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



get_userdata › WordPress Function

Seit0.71
Veraltetn/v
get_userdata ( $user_id )
Parameter:
  • (int) $user_id User ID
    Erforderlich: Ja
Gibt zurück:
  • (WP_User|false) WP_User object on success, false on failure.
Definiert in:
Codex:

Retrieves user info by user ID.



Quellcode

function get_userdata( $user_id ) {
		return get_user_by( 'id', $user_id );
	}
endif;

if ( ! function_exists( 'get_user_by' ) ) :
	/**
	 * Retrieves user info by a given field.
	 *
	 * @since 2.8.0
	 * @since 4.4.0 Added 'ID' as an alias of 'id' for the `$field` parameter.
	 *
	 * @global WP_User $current_user The current user object which holds the user data.
	 *
	 * @param string     $field The field to retrieve the user with. id | ID | slug | email | login.
	 * @param int|string $value A value for $field. A user ID, slug, email address, or login name.
	 * @return WP_User|false WP_User object on success, false on failure.
	 */