I am creating a user programmatically and there is a boolean field (single on/off checkbox) being used as a terms of use inside the users profile.
How do I set the value of it when creating a user object? I need it to be checked or 1.
$new_user = array(
'name' => $username,
'mail' => $email,
//'pass' => $pass,
'signature_format' => 'full_html',
'status' => 1,
'access' => 0,
'timezone' => 'America/New_York',
'init' => $email,
'field_user_account_terms' => array(
'attributes' => array(
'checked' => 'checked',
),
),
);
$account = user_save(NULL, $new_user);
i've also tried
'field_user_account_terms' => array(
'und' => array(
0 => array(
'value' => 1,
),
),
),
I've also tried setting the default value and a bunch of other syntax. Nothing seems to be working for me.
is this even possible? What is the correct syntax for setting the value of a checkbox, to be saved in a users profile?