Checkbox settings not saving their value
-
Hi, I am learning to write WP plugins and I wanted to have a checkbox setting in my plugin’s settings page.
I am able to display the settings and the checkbox is checked/unchecked depending on how I setup the default:<tr valign="top"><th scope="row">Use AJAX</th><td><input type="checkbox" id="use_ajax" name="wp-g2-options[use_ajax]" value="" ><br /><span class="description">If selected the plugin will use AJAX to load the gallery data in the background.</span></td></tr>
However, when I change the checkbox (click on it to change it’s state) and then save the options, the new value of the checkbox is not being saved and the value remains what the default was.
How can I have the options.php page save the correct value for my checkbox?
Thank you
- The topic ‘Checkbox settings not saving their value’ is closed to new replies.