Filter hook 'email_exists'

in WP Core File wp-includes/user.php at line 2098

View Source

email_exists

Filter Hook
Description
Filters whether the given email exists.

Hook Information

File Location wp-includes/user.php View on GitHub
Hook Type Filter
Line Number 2098

Hook Parameters

Type Name Description
int|false $user_id The user ID associated with the email, or false if the email does not exist.
string $email The email to check for existence.

Usage Examples

Basic Usage
<?php
// Hook into email_exists
add_filter('email_exists', 'my_custom_filter', 10, 2);

function my_custom_filter($user_id, $email) {
    // Your custom filtering logic here
    return $user_id;
}

Source Code Context

wp-includes/user.php:2098 - How this hook is used in WordPress core
<?php
2093  	 *
2094  	 * @param int|false $user_id The user ID associated with the email,
2095  	 *                           or false if the email does not exist.
2096  	 * @param string    $email   The email to check for existence.
2097  	 */
2098  	return apply_filters( 'email_exists', $user_id, $email );
2099  }
2100  
2101  /**
2102   * Checks whether a username is valid.
2103   *

PHP Documentation

<?php
/**
	 * Filters whether the given email exists.
	 *
	 * @since 5.6.0
	 *
	 * @param int|false $user_id The user ID associated with the email,
	 *                           or false if the email does not exist.
	 * @param string    $email   The email to check for existence.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/user.php
Related Hooks

Related hooks will be displayed here in future updates.