Updated user role inncorrect when using wp_get_current_user()

Stumbled upon this same issue again, here’s how to fix it.

For some reason, you cannot use wp_get_current_user(), as the data is not updated until a refresh happens.

So instead, you use get_user_by().

// The updated current user
$updated_current_user = get_user_by( 'ID', wp_get_current_user()->ID );