I created a field group for a specific user_role
and a checkbox
type field, such as:
'fields' => array(
array(
'key' => 'field_member_options',
'label' => 'Member Options',
'name' => 'member_options',
'type' => 'checkbox',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'choices' => array(
0 => 'option 1',
1 => 'option 2',
2 => 'option 3',
3 => 'option 4',
),
'allow_custom' => 0,
'default_value' => array(
),
'layout' => 'vertical',
'toggle' => 0,
'return_format' => 'array',
'save_custom' => 0,
),
),
'location' => array(
array(
array(
'param' => 'user_role',
'operator' => '==',
'value' => 'members',
),
),
),
How can I get the keys and values of the checkbox
field? Basically I need them in JSON format to display on a form, without a user of that role being logged in.