WordPress edit_user_profile_update update secondary role

I have finally found solution and the right hook for this: profile_update is called at the end of wp_insert_user in user.php which is called from edit_user.

wp_insert_user ending:

if ( $update )
        do_action('profile_update', $user_id, $old_user_data);
    else
        do_action('user_register', $user_id);

    return $user_id;

Leave a Comment