Community Support Forums — WordPress® ( Users Helping Users ) — 2011-09-01T23:41:45-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14813 2011-09-01T23:41:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14813&p=33725#p33725 <![CDATA[Re: How do I update a s2member custom field in php?]]>
Code:
$s2_custom_fields get_user_option('wp_s2member_custom_fields'$user_id);  


Then try editing the values and update_user_option. https://codex.wordpress.org/Function_Re ... ser_option

Let me know if it helps. :)

Statistics: Posted by Cristián Lávaque — September 1st, 2011, 11:41 pm


]]>
2011-09-01T19:27:00-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14813&p=33694#p33694 <![CDATA[Re: How do I update a s2member custom field in php?]]>
viewtopic.php?f=40&t=12453&src_doc_v=110815#src_doc_get_user_field()

Statistics: Posted by bsowards — September 1st, 2011, 7:27 pm


]]>
2011-09-01T18:49:48-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14813&p=33689#p33689 <![CDATA[Re: How do I update a s2member custom field in php?]]> http://codex.wordpress.org/Function_Ref ... _user_meta

But could anyone provide the syntax for this use case?

Statistics: Posted by bsowards — September 1st, 2011, 6:49 pm


]]>
2011-09-01T18:33:45-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14813&p=33683#p33683 <![CDATA[How do I update a s2member custom field in php?]]>
Here's my code

Code:
$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?

Statistics: Posted by bsowards — September 1st, 2011, 6:33 pm


]]>