Home › Forums › General Issues › Check Box Output Commas › Reply To: Check Box Output Commas
The only way to do this would be to code an acf/format_value filter.
add_filter('acf/format_value/name=myfield', 'my_format_checkbox_field_function', 20, 3);
function my_format_checkbox_field_function($value, $post_id, $field) {
$value = $field['value'];
$values = array();
foreach ($value as $item) {
if (isset($field['choices'][$item])) {
$values[] = $field['choices'][ $item ];
} else {
$values[] = $item;
}
}
$value = implode('<br>', $values);
return $value;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.