为了区分案例1和3,我实际使用了:
add_action( \'profile_update\', \'when_profile_update\', 10, 2 );
function when_profile_update( $user_id, $old_user_data ) {
if (is_user_logged_in()) {
// Updating profile info when logged in
}else{
if (empty($old_user_data->user_activation_key)) {
// Registering
}
}
}
此时,在my site profile\\u中,密码重置不会触发更新,因此案例2不会发生。