I've added a new column to wp_users
table. Now I'd like to update it with wp_update_user()
, however though the method returns no errors, no value is being saved. wp_get_current_user
is returning the new column, but the value is empty.
Does it mean wp_update_user()
can handle only standard columns? Couldn't find anything about that in docs.
I am aware of the meta key-value table for user defined columns, but it would be more convenient to have new field in user table in my scenario.
The code is simple:
$user_info = wp_get_current_user();
$user_info->creditBalance = 44;
$user_id = wp_update_user( $user_info ); // doesn't seem to update the creditBalance