I have created a repeater field on my options page.
The sub fields are… Name (text field) and URL (text field)
I have then successfully managed to populate a checkbox field in a separate Field Group with the options page repeater data. This is done by adding code into functions.php (see code below).
I now want to display the Label and the Value for each checkbox ticked in the Field Group with in my theme. It seems I can only output the Value and not the Label. I noticed that only the “Choices” setting was filled in and the “Default Value” was not filled with corresponding information. See screen shot.
My question is…
Is my functions.php code wrong and how do I output both the value and label of the Checkboxes in my template?
// Add Technology Page Options to Technology Field Group
function my_acf_load_field( $field )
// reset choices
$field['choices'] = array();
// load repeater from the options page
// loop through the repeater and use the sub fields "value" and "label"
$value = get_sub_field('technology_page_link');
$label = get_sub_field('technology_name');
$field['choices'][ $value ] = $label;
// Important: return the field
// v220.127.116.11 and below
// v4.0.0 and above