Cannot save checkboxes values in option page
-
Hello everyone! I’m actually trying to build an option page for my plugin, with only 2 checkboxes.
I use this code to register the 2 settings:
register_setting( 'at_options_group', 'at_option_use_taxarchive'); register_setting( 'at_options_group', 'at_option_show_taxmenu');
And this code to generate the option page:
<div class="wrap"> <form method="post" action="options.php"> <?php settings_fields( 'at_options_group' ); ?> <?php do_settings_fields( 'at_setting', 'at_options_group' ); ?> <table class="form-table"> <tr valign="top"> <th scope="row">My first option title</th> <td> <input type="checkbox" name="at_option_use_taxarchive" <?php if ( 1 == 'at_option_use_taxarchive' ) echo 'checked="checked"'; ?> /></td></tr> <tr valign="top"> <th scope="row">My second option title</th> <td><input type="checkbox" name="at_option_show_taxmenu" <?php if ( 1 == 'at_option_show_taxmenu' ) echo 'checked="checked"'; ?> /></td> </tr> </table> <?php submit_button(); ?> </form> </div>
But when i save, nothing changes in my page ??
Any help would be appreciate
Thanks in advance!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Cannot save checkboxes values in option page’ is closed to new replies.