WordPress开发者和主题制作者的搜索引擎



email_exists ›

Since2.1.0
已弃用n/a
email_exists ( $email )
参数:
  • (string) $email Email.
    Required: Yes
返回:
  • (int|false) The user's ID on success, and false on failure.
定义在:
文档:

Determines whether the given email exists.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/ Conditional Tags} article in the Theme Developer Handbook.



源码

function email_exists( $email ) {
	$user = get_user_by( 'email', $email );
	if ( $user ) {
		return $user->ID;
	}
	return false;
}