Set checbox value with xprofile_set_field_data
Hi, so I want to give new users the ability to register for a newsletter with a checkbox.
When I change the checkbox to a text box field in both my form and buddypress everything works just fine.
$newsletter is either ‘true’ or ‘false’.
Line of code:
$meta_update = xprofile_set_field_data( ‘7’, $user_id, $newsletter);
In Buddypress profile fields I added
Field Title: ‘Newsletter’
Required?: Not required
Field Type: checkboxes
sort order: custom
‘Yes, I want to receive a newsletter’ and ‘default value’ not checked
When registering a new user with a checked checkbox the checkbox on the new user profile page stays unchecked.
(WP 3.6, BP 1.8.1)
You must be logged in to reply to this topic.