Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.
function default_menu() {
<form action="options.php" method="post">
 <?php settings_fields( 'sample_check' );?>
<input type="checkbox" name="sample" value="nofollow"/>

function reg_setting() {

Hi all, I have struggled all day to store the check box values to the register setting. For the text box I used:

<input type="text" name="sam" value="<?php get_option('samip');?>" />

Also I register the values to the register setting like:


But I don't know how to do this for a checkbox. If anyone could give me a suggestion for how to do this, that would be great.

Thanks, vicky

share|improve this question

1 Answer 1

why not simply put checkbox value it in an option instead :

<?php update_option( $option, $new_value ); ?>

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.