可以如下方式检索用户密码(存储为MD5哈希):
$users = get_users();
foreach ( $users as $user ) {
$password = $user->user_pass;
}
假设您有一些已知的passkey值,您可以对其进行哈希运算,并将其与每个用户的密码进行比较:
$passkey = \'somestring\';
$hashed_passkey = md5( $passkey );
$users = get_users();
foreach ( $users as $user ) {
if ( $user->user_pass == $hashed_passkey ) {
// We have a match!
// Do something
}
}