Wordpress Get Password after Admin changes it

139 views Asked by At

I am passing the unhashed password to a different system when user clicks forgot password and changes it. I also want to do the same when the Admin changes the user password from the dashboard and click update. Is there any hook that when admin edits user details i can get the user id and their edited information so i can insert it in anther table. I have tried using

 add_action( 'password_reset', 'my_password_reset', 10, 2 );

But it only works for forgot password?

Any suggestions will be highly appreciated

1

There are 1 answers

0
Akshay Shah On

Hello try this code.

//is run when you edit YOUR profile, and save it
add_action( 'personal_options_update', 'getDataFunction' );
//is run when you edit ANY OTHER profile and save it
add_action( 'edit_user_profile_update', 'getDataFunction' );
function getDataFunction($userId){
 echo '<pre>'; print_r($_REQUEST);
 echo $userId; 
 die();
}

you will get all the data. Let me know if you find any query on answer.