Your problem is that you haven’t included a sanitization function as the third parameter to register_settings on line 111. When no sanitization provided WordPress deletes the value of the option and creates a new one based only on what is passed in $_POST
. Since unchecked checkboxes are not sent by the browser at all you end up with $options['show_admin_dev']
being not set.
You should try to add sanitization which adds the value if it is not in the option
register_setting(
'ccms_developer_options',
'ccms_developer_options',
'ccms_developer_sanit'
);
function ccms_developer_sanit($newval) {
if (!isset($newval['show_admin_dev']))
$newval['show_admin_dev'] = 0;
return $newval;
}
Related Posts:
- WordPress Errors in generated by theme check plugin [closed]
- Call to undefined function add_menu_page() on theme activation
- Efficiency of wp_options vs a new table
- WordPress API Menu/Submenu Order
- What are the advantages and disadvantages of Option Tree over the Customization API?
- How do I add settings to the Background Options Page?
- Customize WordPress>Error Page
- How To Add New Option Types To Option Tree?
- Is it possible ( or advisable) to allow open access to the new theme customizer for potential clients?
- What WP folder can I use to write files to?
- How to limit wordpress menu depth in admin panel
- WordPress Settings API error
- Add a dropdown to theme customizer
- Understanding wp_add_inline_style
- Add a new checkbox in theme options
- Strict Standards Error bootstrap navwalker
- How to add Color Picker in Theme Options for the following?
- Setting multiple default background images?
- Best practice way to implement custom sections into a WordPress theme
- Best practice (forward compatibility) for theme options
- How to set the default value of a option in a theme?
- The seventh parameter passed to add_submenu_page()
- Where is default wp_head() implemented?
- Add a preview to a WordPress Control Panel
- How to deploy a new theme/theme options from staging to production site
- WordPress Customizer Typography: How to load just the unique Google Fonts?
- What is the best way to export and import theme options?
- esc_url not working within add_settings_field callback
- How to remove menus section from WordPress theme customizer
- WordPress Theme customisation CSS
- Select front page and blog page in custom theme settings page
- Fatal error: Call to undefined function get_header()
- Using the theme options to change background
- Cannot update WordPress General Settings Site Title and Tagline
- Theme Options page not showing up in admin menu
- How to hook CSS file according to theme selection in the customizer section
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Change setting name in Customizer and keep the data
- Is there a way to activate different theme for specified users? [closed]
- after_setup_theme, Global Variable and Theme Customizer
- Administration Pages Styling
- menu behavior is not as expected
- Why is the Links Manager visible?
- Is there an action for save_menu and/or update_menu?
- For best DB performance should I serialize all theme options together or by type?
- Set multiple templates per post
- Creating Theme Options Page
- Location of theme options page menu icon
- WordPress add options to theme not displaying
- moving an admin submenu item to a top-level position
- qTranslate with my own theme and settings
- Parse error: syntax error, unexpected T_ENDWHILE in
- Create wordpress header with custom logo in between the menu splitting the menu into two equal parts [closed]
- Access theme options in templates
- Featured Images are not able to be set
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- Can I have two different theme for two different language?
- Using an if statement in the theme customizer page
- How to add “Template” option in page attributes panel?
- How would you accomplish the following advanced settings page?
- Single Page Design, Storing in Theme Options
- How can I make my options in an array and store theme in WP options one DB row?
- How to show custom meta_key in each li of menu
- Show woocommerce categories on my theme menu styling
- How to: JQuery multiple wordpress media uploader buttons in the same options page?
- Following Web Performance Optimization techniques to output static and dynamic css
- How to disable wordpress from overload my stylesheet styles with customizer styles
- How to enqueue javascript for WP Customize options sidebar?
- How do i place same widgets multiple time by default on theme activation?
- Getting php_network_getaddress error : No such host is known?
- Is it possible to save more than one image to an option?
- correct tags for validating input types
- Common single page template options
- What is the meaning of WordPress’s recommended css classes and where are they applied?
- Would to use AJAX to get an option from the database and use it in a jquery setup or is there an alternative to consider?
- How to support letting users add their OWN logo to a custom theme?
- Admin: sub menu doesnt display under apperance when activate my themes
- Change WordPress header color using customizer
- Website pagespeed problem
- How do I use a color from theme options?
- How can I change the theme of different posts using a plugin?
- How to Create custom xml file for demo content for custom theme?
- What Does “Cannot modify header information?” Mean
- How to make javascript work on theme options page
- get_template_part() doesn’t work
- Consequences if using PHP include TEMPLATEPATH?
- WP_editor doesnt apply wpautop on single line content
- Copying the theme style files and images to duplicate the website but with a difference
- Check if( selected() )
- Alignment Problem [closed]
- not getting API setting saved confirmation message after update on option page
- How do I merge 2 WordPress Themes?
- WP Customazation API doesn’t save the default Value
- using Options Framework – can “theme-textdomain” domain be changed?
- Theme Check errors of theme code
- How add built-in textarea in theme development?
- How to get DB options format without saving? [closed]
- Let user to add input fields on theme option page
- Sample Theme Options page for Multisite – what to consider