wp\\u signon存在非常奇怪的问题
下面我将用户凭据传递给wp\\u check\\u password,它返回true,证明密码正确。。。。但是,当我尝试登录时,返回wp\\u error,并显示“错误:您为用户名XXXXXXX输入的密码不正确。”
拜托,谁能解释一下为什么会这样?如何修复?
<小时>
$password = "vdouW#DswYMH"
$hashed = wp_hash_password($password); //$P$Bydu8uFLe8CFXmtGjA71Tfv8Tyo7nH0
if (wp_check_password($password,$hashed,$user->data->ID)) {
echo "Yes, password correct".
$creds[\'user_login\'] = $user->data->user_login;
$creds[\'user_password\'] = $password;
$creds[\'remember\'] = false;
$user2 = wp_signon( $creds, true );
if ( is_wp_error($user2) )
echo $user2->get_error_message().\' - \'.$hashed;
else
echo \'Success<br/>\';
}