Sorry for bumping this old threat, but my problem is the same (I guess). The solutions posted here don’t work.
This is my array:
// CHECKBOX LIST
array(
'name' => __( 'Genres', 'your-prefix' ),
'id' => "{$prefix}checkbox_list",
'type' => 'checkbox_list',
// Options of checkboxes, in format 'value' => 'Label'
'options' => array(
'value1' => __( 'Actie', 'your-prefix' ),
'value2' => __( 'Animatie', 'your-prefix' ),
'value3' => __( 'Avontuur', 'your-prefix' ),
'value4' => __( 'Comedy', 'your-prefix' ),
'value5' => __( 'Crime', 'your-prefix' ),
'value6' => __( 'Detective', 'your-prefix' ),
'value7' => __( 'Drama', 'your-prefix' ),
'value8' => __( 'Fantasy', 'your-prefix' ),
'value9' => __( 'Horror', 'your-prefix' ),
'value10' => __( 'Musical', 'your-prefix' ),
'value11' => __( 'Sci-fi', 'your-prefix' ),
'value12' => __( 'Thriller', 'your-prefix' ),
'value13' => __( 'Western', 'your-prefix' ),
),
I’m using this to output the selected checkboxes:
$values = rwmb_get_field( 'your_prefix_checkbox_list' ); // rwmb_get_value is new function added in 4.5
foreach ( $values as $value )
{
echo $value;
}
Unfortunately, this outputs something like this: “value6value7value12”. What am I doing wrong?
Many thanks!