Drupal - Saving custom fields for nodes and users
I haven't done this with user_save()
before but if it follows convention from the rest of the system (which is likely) it'll be like this:
$values = array(
'name' => $name,
'pass' => $password,
'mail' => $email,
'status'=>1,
'field_foobar' => array(
LANGUAGE_NONE => array(
0 => array(
'value' => $field_value
)
)
)
);
$newUser = user_save('', $values);
In fact there are a few examples further down the page in the user_save()
docs confirming this method is the right one.