-
-
Save toluaddy/77ca4c23ff1c60d0f2e6f31ed4beb1c2 to your computer and use it in GitHub Desktop.
update BuddyPress xprofile programmatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function smc_update_xprofile($userid,$field,$value) { | |
| // alternative to get user ID | |
| // global $current_user; | |
| // get_currentuserinfo(); | |
| // $field = 'Foo'; // xProfile field name | |
| // $value = 'bar'; // desired value | |
| // xprofile_set_field_data($field, $current_user->id, $value); | |
| xprofile_set_field_data($field, $userid, $value); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment