Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have this code on a custom menu:

<form method="post" action="options.php">
  <?php wp_nonce_field('update-options') ?>

  <input type="checkbox" name="myoption[option_one]" value="1"<?php checked( 1 == $options['option_one'] ); ?> />
  <input type="checkbox" name="myoption[option_two]" value="1"<?php checked( 1 == $options['option_two'] ); ?> />

  <input type="submit" name="Submit" value="Update Options" /></p>
  <input type="hidden" name="action" value="update" />
  <input type="hidden" name="page_options" value="logoimageheight" />
 </form>

All i want is to dispaly some checkboxes and save it as a global custom field. When im hitting submit my choice is not stored , what am i doing wrong ?

Thanks Lior

share|improve this question

closed as not a real question by toscho Jul 9 '12 at 21:37

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

Try the following:

<input type="checkbox" name="myoption[option_one]" value="1" <? checked( $options['option_one'], 1 ) ?> />
<input type="checkbox" name="myoption[option_two]" value="1" <? checked( $options['option_two'], 1 ) ?> />

James :-)

share|improve this answer

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