Skip to:
Content
Pages
Categories
Search
Top
Bottom

Set checbox value with xprofile_set_field_data


  • koendb
    Participant

    @koendb

    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.

    Any thoughts?

    (WP 3.6, BP 1.8.1)

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Set checbox value with xprofile_set_field_data’ is closed to new replies.
Skip to toolbar