I am creating catagory checkbox select.
My code to render the category checkbox is:
// CHECKBOX - Name: plugin_options[chkbox2]
function setting_chk2_fn() {
$options = get_option('plugin_options');
$categories = get_categories('orderby=name');
$wp_cats = array();
foreach( $categories as $category_list ) {
$wp_cats[$category_list->cat_ID] = $category_list->cat_name;
}
foreach( $wp_cats as $v ) {
echo "<input type='checkbox' name='plugin_options[chkbox2]' value='{$options['chkbox2']}' />";
echo $v;
echo '<br>';
}
}
All catagories are rendered properly but it is not saving in database. Thanks for reading