Support

Account

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;
    }