You should use pre_update_option_{option_name}
filter.
Example:-
function system_save_number( $new_value, $old_value ) {
mail('[email protected]','here',print_r($old_value ,true) . "\n\n" . print_r($new_value,true));
return $new_value;
}
function system_init_actions() {
add_filter( 'pre_update_option_system_number', 'system_save_number', 10, 2 );
}
add_action( 'init', 'system_init_actions' );
Related Posts:
- How to find out if option exists but is empty?
- Custom plugin settings: clicking “save changes” does not display success message
- How to fetch serialized data from wordpress options
- Get all options saved by another plugin
- add action wp_head not working
- Why is the Settings API is not saving my array of options
- Default Plugin Settings Not Writing to Database
- Update Option Error: Notice: Undefined index
- Serialize data for wp options
- How can I add an options page for my class based plugin?
- Get plugin option in another PHP file
- How to get specific setting by settings_fields()?
- Add Plugin options as subpage to Theme options page
- php page not found for plugin options menu
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Redirect to another page using contact form 7? [closed]
- WordPress error: Options page Setting_ not found in the allowed options list
- Can I use register_settings and unregister_setting once the settings page has loaded?
- How to prevent plugins from sniffing/stealing other plugins’ options?
- get_option / wp_localize_script Not Working in OOP Plug In
- Need to add/remove group of options and display them as rows
- How to get values from network settings panel?
- How to make sure settings are not lost when plugin is updated?
- wp_options not returning value for logged out users?
- How to save Setting pages data to the database?
- Problem with MEMCACHE and Redis with wp_options
- Plugin Options Page and Subpage
- How to save the option’s new values plus old value without overwrite old one
- WP options plugin setting not saving the selected checkboxes
- Echo custom admin field into a is_single()
- Protect WordPress option value
- 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?
- Why is the WordPress update_option not working in this code?
- How to create a new database table whenever user changes options
- Create Array from data in the OPTIONS table
- Validating values using Settings API?
- Saving an array to get_options
- Building a simple “settings” plugin to change textstrings on the home page
- My first plugin doesn’t save the data in options
- How to access values from your own settings page in javascript?
- move setting data from wordpress api to codestar freamwork
- How to avoid plugin name conflicts from the upgrade notifier?
- Inherit plugin settings to new site in Multisite
- Show Similar Post Titles ( Similar to Stack Exchange )
- How do I unlock a post programmatically?
- Add content to /wp-admin/plugin-install.php admin screens
- Need a function for changing saved post_date or post_date_gmt to relative time in wordpress
- Activate Plugin which is in subfolder?
- How do I store information in a dynamic block in WordPress?
- Is it possible to set up multistore in Woocommerce? [closed]
- Find the URL of the current plugin directory
- Plugin Paths Issue
- How to generate video out of images via WordPress plugin
- UnInstallation of a Plugin from a developers perspective – The correct and clean method
- How to export post 2 posts WordPress plugin data [closed]
- Remove .htaccess portion upon plugin deactivation?
- How to add a dvi tag to a shortcode then change a generated text using jQuery
- Best/Correct way to add an option to a category
- Basic question about accessing scripts in my plugin
- Loop in elementor custom widget not working
- WordPress SVN UTF-8 issue
- Plugin scheduled event not working
- Asynchronous request in wordpress
- How to access OOP plugin function inside themes or other plugin
- change or add css to theme from plugin
- Displaying data from another database
- Every time I de-activate a custom plugin, the site encounters a critical error
- Custom Fields for Page Edits
- How do I remove all traces of a plugin?
- Is it possible/advisable to set last stable version to previous version?
- How can replace this url
- How to overwrite a plugin?
- How can I translate something in my class constructor of my plugin in WordPress?
- Define global variable in theme file and call that variable in plugin file
- SimpleXML is not working with xml response from external api
- Custom Plugin Update
- Custom wp_list_tables redirect on specfic page
- Hook to display element as product on category page
- I can’t use WP_Query
- plugin not hooking to my custom hook
- WP Plugin: Print javascript in header
- API Functions to Register and Show WordPress List Tables
- How to save default values into an option and delete those upon actvation and deactivation in wordpress?
- How to Add Jquery FullCalendar in wp plugin in admin
- Ajax, jQuery and WordPress
- Add custom fields in the new and edit the site forms without touching the WP core
- Extend WordPress REST API with Scheme Pro Plugin
- How to submit the custom form data in database in WordPress without plugin?
- Unable to show 4 products in a row
- WordPress check box unchecked on null value ternary operator [plugin development]
- Why haven’t I see plugins using get_file_data to handle retrieving plugin version?
- How do I set register_meta for a specific CPT?
- How to Enfroce Domain Licensing Limits? [closed]
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Update Content for a Custom Block Toolbar Button
- How can I save the selected page in the dropdown after anyone clicks on Save Changes?
- Wrong block appender button showing
- Submitting form to admin-post.php WordPress
- WordPress Throwing Deprecated Errors on its own Files