1179 posts
  • Has referred 200+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+2 more
mabuc says

Hello guys,

I’m using this tutorial- http://net.tutsplus.com/tutorials/wordpress/how-to-create-a-better-wordpress-options-panel, does any of you tried to add multiple checkbox? and save its value..

here’s what I did:
$categories = get_categories('hide_empty=0&orderby=name');
$wp_cats = array();
foreach ($categories as $category_list ) {
    $wp_cats[$category_list->cat_ID] = $category_list->cat_name;
}

array( "name" => "Exclude Category",
            "desc" => "",
            "id" => $shortname."_exclude_blog_category",
            "type" => "checkbox_multiple",    
            "options" => $wp_cats,    
            "std" => ""),    

case "checkbox_multiple":
?>

<div class="rm_input rm_select">
<label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>

<?php foreach ($value['options'] as $option) { ?>
<input type="checkbox" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" value="<?php echo $value['id']; ?>" <?php if (get_settings( $value['id'] ) == $option) { echo 'checked="checked"'; } ?>>
<?php echo $option; ?><br /><?php } ?>

<small><?php echo $value['desc']; ?></small><div class="clearfix"></div>
</div>

<?php break; ?>

It displays the list of categories available, my problem is it only get 1 value from the choices even if I select multiple categories. I appreciate any help.. :)

mark

by
by
by
by
by
by