[英]Wordpress get old and new user details on password_reset hook
I need to capture the hash password before and after password update.我需要在密码更新之前和之后捕获哈希密码。 Using
使用
add_action( 'profile_update', 'updatePassword', 10, 2 );
I am able to successfully capture it.我能够成功捕获它。 How do I achieve it using -
我如何使用 -
add_action( 'password_reset', 'resetPassword',10,2)
Is there some other method to achieve so the same.有没有其他方法可以实现相同的目标。
You can get old password hash by using wp_get_current_user() on pssword_reset您可以通过在 pssword_reset 上使用 wp_get_current_user() 来获取旧密码哈希
add_action('password_reset', 'resetPassword', 10, 2); function resetPassword( $user, $new_pass ) { $oldUser = wp_get_current_user(); //Code for saving your old user data }
You can get new password hash on after_password_reset您可以在 after_password_reset 上获取新密码哈希
add_action( 'after_password_reset', 'afterResetPassword', 10, 2 ); function afterResetPassword( $user, $new_pass ) { //Code for saving your new user data }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.