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
- the function do_settings_section($page) generate error “Allowed memory size of … bytes exhausted”
- framework for plugin/theme options panel? [closed]
- Settings API with arrays example
- How do I add CSS options to my plugin without using inline styles?
- How come `wp_options` table does not have an index on `autoload`?
- Update Option Stored in Multi-Dimensional Array
- Adding Widget form fields dynamically
- Is get_option() faster than accessing get_transient()?
- 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
- Releasing new plugin version, how to rename old options keys?
- WordPress updates defined vs add_filter?
- Creating Settings Page with dropdowns for Plugin
- How to properly sanitize strings for update_option()
- How to add a new plugin page under desired Options page?
- Which to use to execute code during the saving of a plugin settings page?
- Nonce in settings API with tabbed navigation
- Custom plugin settings: clicking “save changes” does not display success message
- How to use the settings API to set multidimensional arrays
- How do I handle multiple Submit buttons in plugin’s option page?
- Deletion of shared options using uninstall.php
- Add Admin Menu Inside Construct or Init
- 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 is not working!
- update_option_{$option} Too Few Arguments
- Save user-specific options in WordPress admin
- How to store accumulate multiple option values in a single array using Options_API
- Why isn’t the Settings API designed to work for plugins using custom admin menus? [duplicate]
- Creating option to allow user to select the page my plugin content will display on
- Unified Approach for Placing Option Pages
- array_map() for sanitizing $_POST
- Does settings API create settings on run time?
- WordPress plugin options and jQuery
- WordPress Plugin Setting’s POST
- 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
- plugin development: storing language specific options
- 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()
- Using the Settings API, how should I add multiple values to an option?
- GET parameters interfere with my plugin settings
- Plugin settings not saving
- Plugin options not being saved or created
- What could cause my plugin’s options/settings page not to load?
- How to set “Site Address (URL)” programmatically on WP multisite?
- null callback in add_settings_section
- Using wp_parse_args to set up Plugin Default Settings
- Single sanitization callback for multiple fields
- Callback is not called in add_settings_field() when passed as part of an array, but recognises that it’s there. It’s passed Class to Class using OOP
- When to use add_settings_section vs just register_setting?
- Storing product price data in the database
- Adding settings link to plugin doesn’t work
- How to fix Uninitialized string offset: error on a checkbox in WP Settings API
- How To Change Post Author Default?
- WP_Editor – Saving Value into Plugin Option – Stripping HTML
- Plugin development: can’t update settings with multiple settings sections
- Editing options pages?
- Multiple options pages validation for a plugin
- How to get specific setting by settings_fields()?
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- Whitelisting items from custom options page
- get_option() not returning expected value from plugin
- The plugin does not save data
- Parse form values before sending to options.php
- Settings API with arrays example
- Allow users to add / remove settings in plugin