1. 首页
  2. WordPress 函数手册

email_exists()

email_exists( string $email )

确定给定电子邮件是否存在。
Determines whether the given email exists.

目录锚点:#说明#参数#返回#源码#笔记


说明(Description)

有关此主题函数和类似主题函数的更多信息,请参阅主题开发人员手册中的条件标记文章。


参数(Parameters)

参数 类型 必填 说明
$email (string) 必需 电子邮件。

返回(Return)

(int|false)成功时用户的ID,失败时为false。


源码(Source)

/**
 * Checks whether the given email exists.
 *
 * @since 2.1.0
 *
 * @param string $email Email.
 * @return int|false The user's ID on success, and false on failure.
 */
function email_exists( $email ) {
	if ( $user = get_user_by( 'email', $email) ) {
		return $user->ID;
	}
	return false;
}
更新版本 源码位置 使用 被使用
2.1.0 wp-includes/user.php:1434 6 1 function

笔记(Notes)

例子

email_exists() 为WP2原创文章,链接:https://www.wp2.cn/functions/email_exists/