Support » Fixing WordPress » What is the "checked" value

  • Hi,
    I try to create a custom function and I need to know what is the “the box is checked” value.
    I got that code:

    <label for="<?php echo $value['id']; ?>"><?php echo $value['name']; ?></label>
    <?php if(get_option($value['id'])){ $checked = "checked=\"checked\""; }else{ $checked = "";} ?>
    <input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="true" <?php echo $checked; ?> />
        <small><?php echo $value['desc']; ?>

    If I know this value I could use it in a php if function. Thank you

  • The topic ‘What is the "checked" value’ is closed to new replies.