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
- How do I add settings to the Background Options 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
- Best practice (forward compatibility) for theme options
- How to set the default value of a option in a theme?
- How to deploy a new theme/theme options from staging to production site
- 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
- Select front page and blog page in custom theme settings page
- Using the theme options to change background
- Cannot update WordPress General Settings Site Title and Tagline
- How to hook CSS file according to theme selection in the customizer section
- 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
- 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?
- 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
- 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?
- How would you accomplish the following advanced settings page?
- 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
- 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?
- Change WordPress header color using customizer
- Website pagespeed problem
- How do I use a color from theme options?
- What Does “Cannot modify header information?” Mean
- How to make javascript work on theme options page
- Consequences if using PHP include TEMPLATEPATH?
- 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 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
- help needed for suit designing tool
- Related Post Category Filter
- WordPress 6.x / PHP 8.x deprecated warnings in development environment
- WordPress custom menu can’t show 3. level submenu
- Gallery functionality in custom theme
- WordPress Animation Adjustments
- In wordpress customizer div still showing even if I hid it with javascript
- Customizer API Multi Sections in single Panel
- Theme does not allow shortcodes
- How to handle theme activation errors?
- Get_header raises an 500 internal server error
- What is an alternative to not using child theme to customize a WordPress theme?
- using themename_the_custom_logo() in template-tags?
- How to customize the colors within a stylesheet using a WordPress setting
- Create settings field on button click
- how can I re-utilize and class on a child theme
- how to call options on front end and add logo
- how to create export / import theme options in wordpress without plugin
- Customizer_register theme options not saving
- Undefined index: custom_sidebars
- Create new sidebars trough admin post/page metabox
- Using Customizer value in an external PHP file inside a theme
- How to add custom field option with menu?
- “No Data Received” error in Chrome every time i try to update the theme functions file
- Strict Standards Error bootstrap navwalker
- Theme Options Doesn’t Work On WP Multisite
- WordPress two sidebar layout or theme
- Theme automatically inserting “more” tag on every post
- Theme Option’s Save Button is not working
- wp_deregister_script was called incorrectly
- Undefined index: debuging error for theme option template snippet
- How to Disable Color Options?
- How do I change the tagline input to textarea?
- Upgrade to WP 3.2/ and Server to php5 breaks theme? [closed]
- Turning WordPress Into full-featured website?
- How to make admin theme option with image slide show?
- Theme.json: creating different sections of the color palette
- Remove nonindex meta tag