Your chunk of code if (isset($_POST['submit'])) {
would process all the form submissions (even other forms which is not your settings page) which is why you are lossing your data. Even though this is not good way to create option page.
But
If you do something like
if(is_admin() && isset($_POST['submit']) && isset($_POST['ffita_gads_capub'])){....
could solve your problem.
Related Posts:
- “Error: Options Page Not Found” on Settings Page Submission for an OOP Plugin
- Is get_option function cached?
- What are the advantages to the Settings API?
- Where to store plugin settings fields
- What’s the best method for emptying an option created with the Settings API?
- Why won’t register_setting() create a setting?
- Performance of several get_option() calls
- Extend plugin options page
- Can I use the different settings sections over different pages using the save options group?
- Correct way check nonce (security) using old Options API
- How to add settings subpage from a plugin to a settings page created in theme?
- Remove Internal Style Sheet if no Value Provided?
- WordPress setting with select – where is my mistake?
- Custom delete option button in plugin settings
- Prevent invalid or empty values from being saved to the database and retain the form field values upon error
- Update problem with update_option() in combination with register_setting()
- Issue on Checkbox with Custom Option Page
- Settings API: Setting default option via ‘get_option’ fails
- add_settings_error on validating plugin options API
- How do I build a settings panel under the plugin
- Add_menu_page and saving settings
- Options don’t save, validation callback not executed
- Settings API not Saving to Database or Display
- Admin Message after Plugin Option Updated
- framework for plugin/theme options panel? [closed]
- Update Option Stored in Multi-Dimensional Array
- How to Use Checkbox in Custom Option Page Using The Setting API
- How should one implement add_settings_error on custom menu pages?
- Accessing plugin settings in gutenberg
- WordPress updates defined vs add_filter?
- Creating Settings Page with dropdowns for Plugin
- How to add a new plugin page under desired Options page?
- Nonce in settings API with tabbed navigation
- Settings API – Undefined Index when unchecking checkbox
- Disable $title in Plugin Options Screen?
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- WordPress Settings API: saving multiple rows of similar data
- Dropdown list of pages to get page id to store in plugin options
- update_option_{$option} Too Few Arguments
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Unified Approach for Placing Option Pages
- array_map() for sanitizing $_POST
- Does settings API create settings on run time?
- WordPress plugin options and jQuery
- What is the use of get_option method
- Options API – Validation Callback $input is NULL
- Generating User(s) with Settings API
- Callback function is being called twice
- Best choice of options/settings framework for plugin/theme development
- How to add a secondary button to a settings page with a custom action?
- Tabbed navigation for plugin options using same row in database for all?
- How to store a medium amount of options?
- Settings not set after calling register_setting()
- GET parameters interfere with my plugin settings
- Plugin settings not saving
- Adding settings link to plugin doesn’t work
- How To Change Post Author Default?
- Plugin development: can’t update settings with multiple settings sections
- Editing options pages?
- Multiple options pages validation for a plugin
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- get_option() not returning expected value from plugin
- The plugin does not save data
- Access bloginfo, get_option, and plugins_url from a non-core php file
- Saving plugin settings – ERROR: options page not found
- get_option() will not work without access to wp-config.php
- WordPress theme options Menu
- Category select options for plugin settings
- Make Database query only when option is updated
- Problem with display data from get_option
- custom wp_editor does not save the content in plugin settings
- Multiple page plugin settings
- Use options to control jQuery plugin
- Update plugin settings option_name for big plugin update
- What could cause a WP Option to get truncated?
- Pause plugin option page until all data manipulation is complete
- Decontruct serialized data array from wp_options
- How to make sure settings are not lost when plugin is updated?
- How to save Setting pages data to the database?
- Settings API not saving
- update_option() passing empty array() but still updating
- Sanitization and validation input fields – Settings API
- Integrating colorpicker into array field
- How to save the option’s new values plus old value without overwrite old one
- How do I add a textarea (multirow) option to my WordPress plugin?
- add_option_{$option} action hook not being called
- Plugin options page: grouping checkboxes
- What should I use instead of get_blog_option?
- Dropdown pages in Settings API
- Can’t switch theme after activation
- Generate activation url
- Settings API with arrays example
- Plugin settings checkbox
- update_option() updating the option with an empty value?
- Updating Style From WP Options Setting Page
- Plugin options page – save two related options as one entry
- Combo/Drop down box on plugin settings page that allows additional options to be added
- Saving multiple fields as array
- Update custom settings field in plugin
- move setting data from wordpress api to codestar freamwork