Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In my wp_usermeta table I have a field called "wp_s2member_custom_fields"

In it is stored this value:


I am trying to use:

update_user_meta( $team_member_id, wp_s2member_custom_fields, $meta_value)

To update "donations_collected" from 10 to 11.

What should I put in $meta_value?

share|improve this question

1 Answer 1

Thats just PHP serialized array notation. You would get that same result by this code:

$meta_value = array(
    'alumni' => 'Yes',
    'donations_collected' => '10'

update_user_meta( $team_member_id, 'wp_s2member_custom_fields', $meta_value);

So if you want to then change the donations_collected value to 11:

$meta_value = get_user_meta( $team_member_id, 'wp_s2member_custom_fields', true );    
update_user_meta( $team_member_id, 'wp_s2member_custom_fields', $meta_value);
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.