I'm developing a WordPress system and I need to check the current user's password on the password edit screen, however I'm having problems with the encryption used in wordpress. I tried the code below published in the codex itself, but I did not have success.
<?php
$wp_hasher = new PasswordHash(8, TRUE);
$password_hashed = '$P$B55D6LjfHDkINU5wF.v2BuuzO0/XPk/';
$plain_password = 'test';
if($wp_hasher->CheckPassword($plain_password, $password_hashed)) {
echo "YES, Matched";
} else {
echo "No, Wrong Password";
}
?>
Any tips?