This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Checklist Field Displays as Array

#5690
Ernest MarcinkoErnest Marcinko
Keymaster

Nice. First of all you need to change back the Advanced description field option to the default {descriptionfield} because we are doing a different solution.

Then, I put together a filter, which parses through each result and gets the ‘my_checkbox_list’ field as per suggested on ACF support forums. Then it’s appended to the description:

[php]
add_filter( ‘asp_results’, ‘asp_checkbox_to_results’, 1, 1 );

asp_checkbox_to_results( $results ) {
foreach ($results as $k=>$v) {
// Get the field
$checkboxes = get_field(‘my_checkbox_list’);
// Append if exists
if( $checkboxes ){
$checkbox_string = implode(‘, ‘, $checkboxes);
$results[$k]->content .= " – " . $checkbox_string;
}
}

return $results;
}
[/php]

Hopefully it will work.