WP_User::exists()publicWP 3.4.0

Determines whether the user exists in the database.

Method of the class: WP_User{}

No Hooks.

Return

true|false. True if user exists in the database, false if not.

Usage

$WP_User = new WP_User();
$WP_User->exists();

Changelog

Since 3.4.0 Introduced.

WP_User::exists() code WP 6.4.3

public function exists() {
	return ! empty( $this->ID );
}