How do I update a s2member custom field in php?
Posted: September 1st, 2011, 6:33 pm
I'd like my template to read in a custom field, and update the number by one.
Here's my code
How should I be updating this custom field with the new number?
Here's my code
- Code: Select all
$team_member = get_userdata(intval($team_member_id));
$team_member_donations_collected = $team_member->wp_s2member_custom_fields["donations_collected"];
$team_member_donations_collected_update = (int)$team_member_donations_collected + (int)$amount;
//this last line causes an error
update_usermeta( $team_member_id, wp_s2member_custom_fields["donations_collected"], $team_member_donations_collected_update );
How should I be updating this custom field with the new number?