Note what happens when you provide sanitize callback in register_setting()
. It register a filter to sanitize your options
add_filter( "sanitize_option_{$option_name}", $sanitize_callback );
Now when you do update_option()
then trigger your own function to prevent saving 😀
Because update_option()
calls $value = sanitize_option( $option, $value );
Solution:
Remove register_settings()
callback before you call update_option()
.
function gtp_remove_installing_data() {
//Your code
//Remove sanitizing for adding
remove_filter( "sanitize_option_installing_data", 'gtp_register_installing_data_setting' );
// Update
$installing->update();
die;
}
Related Posts:
- Issue on Checkbox with Custom Option Page
- “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
- How to Use Checkbox in Custom Option Page Using The Setting API
- 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
- Category select options for plugin settings
- Settings API: Setting default option via ‘get_option’ fails
- It is possible to pass $args that sent by add_settings_field() inside another function?
- Plugin setting page – update_option problem
- How Can I Update wp_enqueue_scripts () From WordPress Option Page Radio Buttons
- add_settings_error on validating plugin options API
- Dropdown pages in Settings API
- How do I build a settings panel under the plugin
- Add_menu_page and saving settings
- Updating Style From WP Options Setting Page
- 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]
- Settings API with arrays example
- How do I add CSS options to my plugin without using inline styles?
- Is get_option() faster than accessing get_transient()?
- How should one implement add_settings_error on custom menu pages?
- 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
- How to use the settings API to set multidimensional arrays
- Deletion of shared options using uninstall.php
- Multiple entries in get_option results? or why is _multiwidget set to 1?
- update_option_{$option} Too Few Arguments
- 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]
- array_map() for sanitizing $_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
- How to store a medium amount of options?
- WordPress security issue to output data from user input from theme option form
- Plugin options not being saved or created
- 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
- Adding settings link to plugin doesn’t work
- How to fix Uninitialized string offset: error on a checkbox in WP Settings API
- Multiple options pages validation for a plugin
- How to get specific setting by settings_fields()?
- Add Plugin options as subpage to Theme options page
- 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
- Parse form values before sending to options.php
- Settings API with arrays example
- Allow users to add / remove settings in plugin
- Access bloginfo, get_option, and plugins_url from a non-core php file
- get_option() will not work without access to wp-config.php
- Default settings aren’t used
- Can I use register_settings and unregister_setting once the settings page has loaded?
- WordPress theme options Menu
- Make Database query only when option is updated
- not getting API setting saved confirmation message after update on option page
- Problem with display data from get_option
- 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?
- Decontruct serialized data array from wp_options
- How to save Setting pages data to the database?
- Settings API not saving
- update_option() passing empty array() but still updating
- Hide / show settings field based on other field’s value
- Integrating colorpicker into array field
- How to save the option’s new values plus old value without overwrite old one
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- How do I add a textarea (multirow) option to my WordPress plugin?
- Cannot save settings value
- add_option_{$option} action hook not being called
- From my Plugin Settings Page use check boxes to load specific css files (e.g. Bootstrap / Foundation)
- Plugin settings checkbox
- update_option() updating the option with an empty value?
- Error on using __FILE__ for add_menu_page() Function
- 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
- Menu_slug used for creating options page
- How to delete all the options in an option group