email_exists
Checks whether the given email exists.
Description
(int|false) email_exists( (string) $email );
Returns (int|false)
The user's ID on success, and false on failure.
Parameters (1)
- 0. $email (string)
- The email.
Usage
if ( !function_exists( 'email_exists' ) ) { require_once ABSPATH . WPINC . '/user.php'; } // The email. $email = ''; // NOTICE! Understand what this does before running. $result = email_exists($email);
Defined (1)
The function is defined in the following location(s).
- /wp-includes/user.php
- function email_exists( $email ) {
- if ( $user = get_user_by( 'email', $email) ) {
- return $user->ID;
- }
- return false;
- }