您的当前位置:首页 > 知识博客 > wordpress建站

WordPress检测用户邮箱是否存在函数:email_exists

时间:2024-03-09

WordPress函数email_exists用于检测指定邮箱用户是否存在,如果存在就返回该用户的ID。

email_exists( string $email )

函数参数

$email

字符串

用户邮箱地址。

函数返回值

如果用户名存在,返回该用户的ID,否则返回false

函数使用示例

$email = 'service@tiezhushuo.com';
$exists = email_exists($email);
if($exists) {
    echo "用户的ID是:" . $exists;
} else {
    echo "没有找到相关的用户";
}

扩展阅读

email_exists()函数位于:wp-includes/user.php

相关函数:

  • get_user_by()

  • edit_user()

  • register_new_user()

  • wp_insert_user()

  • username_exists()


欢迎咨询/Welcome to inquire
tel/vx:18842938855
qq:1685522781
email:1685522781@qq.com

Copyright © 2019-2024 sex.cyou


Whatsapp
Powered by RRZCMS