A WordPress-centric search engine for devs and theme authors



email_exists ›

Since2.1.0
Deprecatedn/a
email_exists ( $email )
Parameters:
  • (string) $email Email.
    Required: Yes
Returns:
  • (int|false) The user's ID on success, and false on failure.
Defined at:
Codex:

Determines whether the given email exists.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.



Source

function email_exists( $email ) {
	if ( $user = get_user_by( 'email', $email ) ) {
		return $user->ID;
	}
	return false;
}