Are you sure $user->user_profile_setup
is the correct way to reference the meta info?
# does 'user_profile_setup' show up under wp_get_current_user()?
print_r(wp_get_current_user());
I think you mean to do:
function first_time_login( $redirect_to, $user){
if( get_user_meta($user->ID, 'user_profile_setup', true) == 'true' ){ //edited line
return $redirect_to;
}
else{
return "/account-setup?redirect_to='". $redirect_to . "'";
}
}
Assuming that
$current_user = wp_get_current_user();
print_r(get_user_meta($current_user->ID));
Outputs
Array
(
...
[user_profile_setup] => Array
(
[0] => true
)
...
)