• Resolved tbare

    (@tbare)


    I’ve added a bit of code in the shortcode function (at line 495) to make a checkbox show as comma separated —

    //if the field is a checkbox field
    elseif(is_array($field_value) && $field["type"] == "checkbox" ) {
    
    	//sort the array by key
    	ksort($field_value);
    	$field_values = "";
    
    	// Concatenate field values into string separated by a comma
    	foreach ($field_value as $field => $value) {
    	   if($value !== "") { $field_values .= $value . ", "; }
    	}
    	$field_values = trim($field_values, ', '); // strip the last ', ' space from the end of the string
    	$list_html .= "<td class='sort-$i $nowrap $tdClass'>$field_values</td>";
    }

    May be worth an adding in (or as an option) in a future release?

Viewing 1 replies (of 1 total)
  • Plugin Author fried_eggz

    (@fried_eggz)

    Good idea! I have added a setting for this (will be included in version 1.5) where you can choose between space or comma. The setting is located under “General settings” and its called “Multiple values separator”.

Viewing 1 replies (of 1 total)

The topic ‘Comma separate checkbox fields’ is closed to new replies.