To execute a task after a option has been updated, you can use updated_option
action hook:
add_action( 'updated_option', 'updated_option_callback', 10, 3 );
function updated_option_callback( $option, $old_value, $value ) {
//Do something
}
Also, you can use update_option_{option-name}
specifically for each option. For example:
add_action( 'update_option_new_option_name', 'update_new_option_name_callback', 10, 2 );
function update_new_option_name_callback( $old_value, $value ) {
//Do something
}
Related Posts:
- Contact form 7 select box different value-text than content-text in option [closed]
- Plugin development: how to create a form and get custom data?
- Image upload and other options in the same plugin settings form?
- WP Plugins – Use includes to display page content
- Editing a text file from plugin menu
- How do you add a settings page to another menu?
- Plugin option for input box validation
- Upgrade 4.5.2 to 4.5.3 deleting row in wp_options table
- Modifying a JS file with data from plugin settings
- Simple form that saves to database
- Is there a hook attached to general settings save?
- How should I use register_setting, add_settings_section, & add_settings_field in my plugin’s options page?
- Add custom meta box on Post page
- Master menu item for multiple plugins?
- Detecting when a custom taxonomy has been changed and display alert?
- How to disable autocomplete for inputs in contact form 7? [closed]
- WooCommerce “Save Changes” button appears inside custom settings
- Remove obsolete plugins artifacts from database tables
- reorder plugin menu position
- Hide Theme options and Customize Admin menu
- How to debug register_setting callback function
- Why is the Settings API is not saving my array of options
- Can’t get plugin settings page to save data
- How to send little data between admin pages of my plugin?
- How do i save plugin-specific info?
- How can I add an options page for my class based plugin?
- problems with wordpress and php version 5.3.3-1
- Custom form action to handle data inside a plugin
- wp_create_nonce function doesn’t work inside a plugin?
- How to get specific setting by settings_fields()?
- Add Plugin options as subpage to Theme options page
- Show existing POST categories as items in the sidebar menu [closed]
- Submit page limited in time to upload image
- Ajax fail and get 504 error
- Trying to fix form resubmition with PRG (Getting error: Cannot modify header information – headers already sent by)
- Dynamic admin submenu
- How to create an option page for this simple plugin
- How to use add_submenu_page() for editors?
- Is there a way to embed a Google Docs form in a page without using plugins?
- Submit Form data to another page via Ajax (WordPress Way)
- Can I use register_settings and unregister_setting once the settings page has loaded?
- Updating options into the wp database performance
- Change the style of h1, h2, only in post entry
- Display Plugin Panels Outside of Admin Areas
- add_submenu_page returns null
- get_option / wp_localize_script Not Working in OOP Plug In
- Creating a form and displaying entry data as a table
- How to remove a CPT Menu from the Root Admin only
- Show WordPress Plugin Menu(Admin) To Editor
- Custom form not showing in correct place on page
- Every time I save my plugin options it erases another plugin options
- Changing plugin options from theme functions file?
- Call another page in forms
- How to Use the Filter “sidebar_login_widget_form_args”
- Select Form Element Not Saving from Plugin Options
- Contact Form 7 Plugin emails not being received by some accounts
- Multisite Plugin – Access options (wp_options) on child sites
- Adding custom Field To The Posts Listing
- What is the most efficient way of adding additional functionaliy for admin only
- Color Picker UI in admin is not correct
- How to save Setting pages data to the database?
- User loggedin as Subscriber form not sending
- Creating an admin button that when clicked shows a popup form
- How to get data from a form on a wordpress site?
- add menu page not showing Icon
- General Term for this form Field
- Load google font script based on optgroup label selected
- Custom Icon assigned to menu items not working for multi-site networks
- How to send custom mail when a user complete a specific form
- How to submit custom form data using ajax to HubSpot form?
- How to save the option’s new values plus old value without overwrite old one
- Echo custom admin field into a is_single()
- WordPress Boilerplate Plugin doesn’t see callback functions for add_settings_field and add_settings_section
- How to detect if i am on plugin’s settings page
- Creating Admin Submenu Page via Class Method
- How to store multiple instances of the plugin’s options for various shortcodes
- Manual Backup – How to save to Firefox or Chrome (instead of IE which brings up popup I can’t get rid of)
- Pause form submissions while upgrading plugins
- Register setting on plugin activation
- How to hide the form after successful php execution
- How can I automatically send an email with an excel file containing submissions for a form rather than an email per submission?
- Options page textarea to populate custom post select field
- Include plugin form in the home page
- How can i see/log all requests coming from a registration form (not from the UI)?
- Add a checkbox in plugin options page and make it actually work
- Form submit from wordpress plugin
- Is saving multiple options or saving multiple items in one option better?
- How do I convince this button to do something when it is clicked?
- How can I pass value to function in add_menu_page?
- ‘all’ hook and get_option issue
- How to find an option in the database?
- Carrying information from button click into form [closed]
- Building a simple “settings” plugin to change textstrings on the home page
- County Finder form/plugin?
- How to Allow Users to Select Recipients In a WordPress Comment section?
- Neither update_option nor delete_option fires in deactivation hook
- Form with response button after on table after submission
- Tips on using a custom template with Ultimate Member
- move setting data from wordpress api to codestar freamwork
- Can’t save formdata in DB