Title: Problems WIth Developing Plugin
Last modified: August 18, 2016

---

# Problems WIth Developing Plugin

 *  [ilearneditonline](https://wordpress.org/support/users/ilearneditonline/)
 * (@ilearneditonline)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/problems-with-developing-plugin/)
 * I am having problems getting get_option to work the way I would think it does.
   When I register my plugin, I use the following to add the 2 options for my plugin.
 *     ```
       add_option('wordpress_giveaway_plugin_require_registration', true, __('Entrant Must Be Registered?'),'yes');
       		add_option('wordpress_giveaway_plugin_daily_entry', true, __('Entrant Can Only Enter Once Per Day?'),'yes');
       ```
   
 * Which does enter the values into the options table as I would expect it to. But
   when I go to the options page for the plugin I do
 * `<?php if(get_option('wordpress_giveaway_plugin_daily_entry')) echo " checked";?
   >`
 * which should show checked by default. But it do not. So if I check the box and
   update options, it will show as checked until I close the browser, then it is
   back to unchecked.
 * Thank you in advance.
 * [redscorpion@ilearneditonline.com](https://wordpress.org/support/topic/problems-with-developing-plugin/redscorpion@ilearneditonline.com?output_format=md)

Viewing 1 replies (of 1 total)

 *  [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * (@gamerz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/problems-with-developing-plugin/#post-528790)
 * use
    `<?php checked('1', get_option('wordpress_giveaway_plugin_daily_entry'));?
   >`
 * You should use 1 or 0 instead of true or false when inserting the option

Viewing 1 replies (of 1 total)

The topic ‘Problems WIth Developing Plugin’ is closed to new replies.

## Tags

 * [Get_Option](https://wordpress.org/support/topic-tag/get_option/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lester Chan](https://wordpress.org/support/users/gamerz/)
 * Last activity: [19 years, 1 month ago](https://wordpress.org/support/topic/problems-with-developing-plugin/#post-528790)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
