August 26, 2015 at 10:49 am
#5690
Ernest 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.