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
- How to create an option page for this simple plugin
- Add menu page issues (permissions & position)
- Redirect to another page using contact form 7? [closed]
- get_option error plugin development
- How to use add_submenu_page() for editors?
- AJAX fileupload – TypeError: not a function ajaxSubmit()
- Is there a way to embed a Google Docs form in a page without using plugins?
- What’s causing this error? “Warning: Invalid argument”
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- easy steps to make front end form without plugin
- Gathering and logging data from a plugin: how to do it without race conditions?
- Form that generates an ID for the customer
- Update a core option from plugin settings page
- WordPress error: Options page Setting_ not found in the allowed options list
- Move plugin-settings to ‘Settings’-menu in the admin
- Submit Form data to another page via Ajax (WordPress Way)
- Can I use register_settings and unregister_setting once the settings page has loaded?
- update_option_{$option} not showing old value
- WordPress Admin Menu defining function is seperate file
- Updating options into the wp database performance
- Can deactivating a plugin sometimes “reset” settings within that plugin?
- Allowed memory size exhausted problem
- Change the style of h1, h2, only in post entry
- Plugin getting Cannot modify header information errors
- Ajax Plugin Not Echoing Response
- How to add options to the plugin page?
- Saving widget options from class method
- creating a plug in that would tap into save/update action of posts [closed]
- Plugin that will output submitted form data for user? [closed]
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- How to prevent plugins from sniffing/stealing other plugins’ options?
- Display Plugin Panels Outside of Admin Areas
- Default plugin config to override wp_options?
- How do I add the same contact form to multiple wordpress sites and capture the response in one place or database?
- Why WP_Screeen doesn’t show all options with admin_body_class
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Plugin Admin Menu Boiler Plate
- add_submenu_page returns null
- get_option / wp_localize_script Not Working in OOP Plug In
- OceanWP settings are missing from Add New Post [closed]
- Change in one place the data about the company, which are placed on several pages
- Plugin – Admin menu page broken url
- Creating a form and displaying entry data as a table
- Plugin scheduled event not working
- How do I add an options page at the bottom of the list?
- Update WP option by plugin
- How to save plugin custom settings page fields
- How to remove a CPT Menu from the Root Admin only
- How can ι create my own (custom) WordPress table/list?
- Gravity Forms returns to odd position
- Storing The Data Collected by Ninja Forms into Another (custom) Database [closed]
- WordPress Multi-Step Product Search
- Sell access to form [closed]
- How to reinstate previously saved option?
- File Uploader – Upload without adding to Media Library
- How (or where) do I get wordpress plugin update download link?
- Show WordPress Plugin Menu(Admin) To Editor
- Adding option values as an array using a multi selectable select box
- Store plugin page content in wp_options?
- Add logo to admin menu in my plugin
- Custom form not showing in correct place on page
- add_meta_box creating default form field types
- Every time I save my plugin options it erases another plugin options
- Form Plugin for Api Requests which is used via Shortcode
- Changing plugin options from theme functions file?
- How to redirect to a page after the form is submitted
- Call another page in forms
- Adding a theme option to the admin that lets me turn on/off a javascript file
- Echo out element to another page.
- How to make a textarea accept javascript in my settings apge?
- How to Use the Filter “sidebar_login_widget_form_args”
- Select Form Element Not Saving from Plugin Options
- Storing Form data in a different database
- Is it save to replace with in WordPress search form
- Contact Form 7 Plugin emails not being received by some accounts
- Contact Form 7 “non-selectable” options in a drop down [closed]
- Localise settings section headline
- Using AJAX to run SQL statement and populate dropdown
- Custom page in plugin visible in menu
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Need to add/remove group of options and display them as rows
- Multisite Plugin – Access options (wp_options) on child sites
- How to get values from network settings panel?
- Looking for a simple checkout plugin [closed]
- How to add a custom form to a plugin’s setting page
- update_option creates an option, which empties on a blog reload
- Redirect plugin after form submit or show errors
- Plugin for visitors to edit content without logging in? [closed]
- Using call_user_func() within add_settings_section() within a Class
- Adding custom Field To The Posts Listing
- What is the most efficient way of adding additional functionaliy for admin only
- How do I send the contents of a form to deliver to the already existing custom field in the wordpress theme
- Color Picker UI in admin is not correct