email_exists()
email_exists( string $email ) 确定给定电子邮件是否存在。Determines w…
email_exists( string $email )
确定给定电子邮件是否存在。
Determines whether the given email exists.
目录锚点:#说明#参数#返回#源码#笔记
说明(Description)
有关此主题函数和类似主题函数的更多信息,请参阅主题开发人员手册中的条件标记文章。
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| (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)
例子
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!