Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[WordPress] Saving Empty Radio Button Values in WordPress
<div class="options">
<p>
<label>A generic label for your option.</label>
</p>
<p>
<input type="hidden" name="acme[key]" value="" />
<label>
<input type="radio" name="acme[key]" value="yes"
<?php checked( 'yes', $options['acme']['key'], true ); ?>
/>
Yes
</label>
<label>
<input type="radio" name="acme[key]" value="no"
<?php checked( 'no', $options['acme']['key'], true ); ?>
/>
No
</label>
</p>
</div><!-- .options -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment