wp_authenticate()判断帐号密码是否正确

目录

描述

Checks a user's login information and logs them in if it checks out.

  • This is a plugabble function, which means that a plug-in can override this function.
  • Not to be confused with the wp_authenticate action hook.

wp_authenticate() 描述

参数

$username

(string) (必填) User's username

默认值: None

$password

(string) (必填) User's password

默认值: None

wp_authenticate() 参数

返回值

(mixed) 

Returns WP_User object if login successful, otherwise WP_Error object.

Errors can be verified with is_wp_error()

wp_authenticate() 返回值

历史

添加于 版本: 2.5.0

wp_authenticate() 历史