wp_get_current_user() returns an object.

update_user_meta( $user_id, $meta_key, $meta_value, $prev_value ) accepts user_id as first parameter.

Use the following code to get user ID from:-

$user  = wp_get_current_user();

update_user_meta( $user->ID, ‘custom_user_fields’, $userData );

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.