• I am using the plugin flutter for creating custom write panels.

    I can call all the custom fields with no troubles, except for the fields i have made checkboxes.

    They simply return the word “array”

    I use the call method they supply get('hello', 1, 1, true)

    i have also used the wordpress method get_post_meta($post->ID,'hello', true) with no luck.

    How do i get the value of the checkbox that is selected to display.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Checkboxes are tricky – they generally return arrays, so you need to handle them as such. The reason they return the word “Array” when you try to echo the output is because that is what that variable is: an array.

    You might try iterating thruogh the checkbox array to get the values you want with a foreach loop. Whatever the case, do a little research on checkboxes in html, and arrays in php, and you should find your answer.

    Thread Starter Warwick Booth

    (@krugazul)

    Thanks, but it turns out the plugin is not saving any other types of fields (checkbox, radio button etc) except the text fields.

    I checked the Database in the wp_postmeta table.

    Show checkbox list:

    $checks = get('checks_name');
    $output = "";
    foreach($checks as $check){
    	$output .= "<span>$check</span> ";
    }
    echo $output;
    // or return $output
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Flutter Check Boxes’ is closed to new replies.