• I know I can do a query to lookup a user by email address, but I’m sure I remember seeing a wordpress function that allowed you to lookup a user by email. I can’t find what this function is though. I think you passed it a parameter like ’[email protected]’.

    Does anyone know what this function is named?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Purab

    (@wordpressapi)

    there is no ready made function provided by wordpress you should try the following code.

    $querystr = "SELECT wp_users.* FROM $wpdb->users
            WHERE wp_users.user_email = '[email protected]' ";
    	 $userinfo = $wpdb->get_row($querystr);

    If you still facing the issue then write to me at [email address removed]

    In pluggable.php you’ll find a function named “get_user_by_email”. Full function definition is below:

    /**
     * Retrieve user info by email.
     *
     * @since 2.5
     *
     * @param string $email User's email address
     * @return bool|object False on failure, User DB row object
     */
    function get_user_by_email($email) {
    	return get_user_by('email', $email);
    }
    vusis

    (@vusis)

    thanx! supa

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get user by email address’ is closed to new replies.