Yep you are missing something, On your validate_options function you need to:
- get an array of all existing options.
- update only the options your Submenu
page handles. - return that array.
So something like:
function validate_options($input){
//do regular validation stuff
//...
//...
//get all options
$options = get_option(THEMENAME . '_settings');
//update only the neede options
foreach ($input as $key => $value){
$options[$key] = $value;
}
//return all options
return $options;
}
Related Posts:
- Save Theme Options (options.php) From The Frontend
- Can’t save options
- How to save custom settings api fields with custom section fuction
- display category name based on its equivalent id
- Are transients garbage collected?
- Are all options loaded to memory on each request?
- How does object caching work?
- How to pass arguments from add_settings_field() to the callback function?
- How to use checkbox and radio button in options page?
- how to update serialized options programatically?
- get_option() vs get_theme_mod(): Why is one slower?
- How to pass variable to add_settings_section() callback?
- Performance with autoload and the options table
- What’s the difference between Options & Settings?
- Using widget options ‘outside’ the widget
- How to load WordPress on non WP page?
- Options for CDN with WordPress Including Supporting Plugins?
- Option to set static front page disappeared from admin reading settings
- How to set up default values for a plugin?
- Difference between Option_Group and Option_Name in Register_Settings
- How To Add New Option Types To Option Tree?
- Best practices for a Style/CSS based theme options page?
- Add on the fly tabs to plugin options
- Why does WordPress use serialize rather than json_encode for the options table? [duplicate]
- Plugin options will not save in database
- No option to allow search engines to index my site in WP 4.3
- How to update an ‘array’ option using wp-cli [duplicate]
- Plugin options autoloading
- How to Create a Custom WordPress Install Package?
- Settings API – creating reusable form elements?
- Settings API – changing add_settings_field() output?
- Confirmation before deleting plugin options via uninstall.php
- Efficient way of saving plugin options
- Set WordPress settings programmatically
- Fallback when Transient API fails
- get_option() from another wordpress site
- How can I get all user options?
- Site Title and Tagline in Theme Options Page
- register_setting() vs add_option()
- Settings API – save an array of options as one setting (array_push?)
- Where to hook register_settings for Settings API when also want to update options outside of Settings API?
- Add_settings_field() parameterizing callback?
- How much string content can I store in an option?
- Set a Default Value for an Option?
- Using update_option() and get_option() is echoing escaped strings
- Editor role cannot save custom theme options
- Theme Options page with tabs
- Setting ‘autoload’ to ‘no’ with Settings API
- Outputting results from select box option in options panel
- Site Title and Tagline in Pagelines DMS Options Panel
- Why isn’t get_option array contents displaying?
- How to Save Different Settings Options Using Settings API and/or the Theme Optimizer
- Define WordPress image size in img tag
- Serialized settings in rest api
- Editor role not saving settings page for custom post type
- get_option() is not working even db contains the corresponding option_name and option_value
- Can’t output do_settings_sections . Can’t understand why
- checkbox with get_option not working
- Separate backend “Widgets” page for each language
- Settings API – how to update multiple options manually?
- Single callback with multiple setting fields
- Display user HTML on website
- Need help understanding/coding with Settings API
- Proper use of option_page_capability_{$page_name}
- Settings API – how to update options manually?
- How to change the file upload directory on version 3.5?
- Which WordPress option stores the current active theme?
- update_option method with support of utf8
- Any way to partition wp_options?
- Theme options WP Editor
- How do I add a value to a wp_options option that is an array?
- how can I detect that option value has changed?
- Can I use a space in an option name/key?
- How to save WordPress Options as an array?
- update_option not working in stand-alone PHP script
- How to verify this checkbox is checked?
- How to display some settings for super admin user only using Settings API
- Best practice differences in DB options and wp-config between live, staging and local WordPress environments?
- Logout redirects to a broken page(home URL is omitted)
- What to use , set_transient, set_option or file system? [closed]
- How to mark an option as selected
- Is there a limit to the number of options you can store in one settings field of wp_options?
- wp_user_roles and Advanced Manipulation
- Settings API get_option best practices
- Custom theme options Radio inputs not saving
- Deploy pre-configured database
- Cannot update WordPress General Settings Site Title and Tagline
- Is there a reliable way to keep track of how long a WordPress theme has been active?
- Character Encoding for wp_options
- Access general settings trough wordpress files
- get_option & update_option for multiple input fields with same name
- Settings API: Change position of custom setting field
- Tab from Settings API resetting all options with INSERT INTO [closed]
- Clone plugins (and settings) to new installation?
- Getting settings saved two times in settings page with tab
- display all posts in wordpress admin crashing after 999 screen option
- How to cache posts based on $_GET? Option name is too long? Options / transients
- Allow spiders to crawl my site (selectable option in wp)
- Putting my site live
- Where is the submitted $_POST array stored after an option page submission?