Making radio button default value on plugin setting page
-
I’ve created a plugin which has some radio buttons on the settings page.
I can get these to display/save with no problems. However if I first activate the plugin, none of the options are checked.
Code I’m using:
<label>List</label> <input type="radio" name="faq_accordion_style" id="faq-list-check" value="1" <?php if (checked( get_option('faq_accordion_style'), 1 )); ?> /><br /> <label>Accordion</label> <input type="radio" name="faq_accordion_style" id="faq-accordion-check" value="2" <?php if (checked( get_option('faq_accordion_style'), 2 )); ?> /><br />
How can I set the first radio button option (List) as the defaulted checked value?
Any help much appreciated.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Making radio button default value on plugin setting page’ is closed to new replies.