I am developing a plugin where a MySQL user is created with username same as WP-username and password is entered by user using form .
Now If the user resets its password in WordPress then the same password should be set in MySQL user.
for that purpose I tried to use password_reset hook but it is not working
Code:
I use this code in init
add_action('password_reset',array(&$this,'my_reset_password'),10,2);
and define the function as:
function my_reset_password($user, $new_password)
{
$data=array('slave_name'=>$new_password);
$where=array('site_user_id'=>$this->user_id);
$res=$this->update_data(TABLE_PREFIX.'slaves',$data, $where);
//return $res;
//var_dump($new_pass);
//$this->flag=$new_pass;
}
The above code runs successfully as individual but when hooked with password_reset it is not working.
suggestions with code samples will be appreciated.