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

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Checklist Field Displays as Array Reply To: Checklist Field Displays as Array

#5694
Ernest MarcinkoErnest Marcinko
Keymaster

Hi!

If the normal description is showing, then the “if ( $checkboxes ) …” part of the code is not executed. I think the ACF get_field() function needs a post ID as well. Try this modification of their suggestion:

[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’, $v->id);
// Append if exists
if( $checkboxes ){
$checkbox_string = implode(‘, ‘, $checkboxes);
$results[$k]->content .= " – " . $checkbox_string;
}
}

return $results;
}
[/php]

  • This reply was modified 10 years, 9 months ago by Ernest MarcinkoErnest Marcinko. Reason: fix