case "radio":
foreach ($value['options'] as $option) { ?>
<label for="<?php echo "{$value['id']}_{$option}"; ?>">
<input
type="radio"
name="<?php echo $value['id']; ?>"
id=<?php echo "{$value['id']}_{$option}"; ?>
value="<?php echo $option; ?>"
<?php checked($option, get_settings($value['id'])); ?>
/>
<?php echo $option; ?>
</label>
<?php }
break;
But I don’t recommend coding theme/plugin settings this way.
The array above doesn’t just represent the option:value, but also the type of input, possible values (description, id?)… This just feels wrong. And you’re making the code lack flexibility.
What if you decide later to change a select field with a radio field?
Or what if you want to add a image describing the option, or a color picker?
Why do you think WP’s core options are not coded this way?