I want to make a custom login system in wordpress. Such that it asks for username & password. But it is not authenticating the user with the given password because it is different with the password stored in db (it is in hashed form).
I read the wordpress codex for validating password I found wp_check_password method. I tried to implement wp_check_password in the below code but it is not working. Is my code missing something??
The input provided by the user
username: admin & password: pass1q@.//aa
The hashed password stored in the database
$P$BY.HywWHy.bpgmBZzyV6RGxG/m6.3u/
Here is the code which I am using for validation
$password_hashed = '$P$BY.HywWHy.bpgmBZzyV6RGxG/m6.3u/';
$plain_password = 'pass1q@.//aa';
if($wp_check_password($plain_password, $password_hashed)) {
echo "YES, Matched";
} else {
echo "No, Wrong Password";
}
Can anyone plz help me with that. Thanks looking for a positive response from the developer community.