Skip to:
Content
Pages
Categories
Search
Top
Bottom

Set checbox value with xprofile_set_field_data

  • Avatar of koendb
    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 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.