Codex tools: Log in
Contents |
This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.
Create a hash (encrypt) of a plain text password.
For integration with other applications, this function can be overwritten to instead use the other package password checking algorithm.
<?php wp_hash_password( $password ) ?>
Compare an already hashed password with it's plain-text string:
<?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";
}
?>
wp_hash_password() is located in wp-includes/pluggable.php.