update_option
Fires immediately before an option value is updated.
Usage
add_action( 'update_option', 'wp_kama_update_option_action', 10, 3 ); /** * Function for `update_option` action-hook. * * @param string $option Name of the option to update. * @param mixed $old_value The old option value. * @param mixed $value The new option value. * * @return void */ function wp_kama_update_option_action( $option, $old_value, $value ){ // action... }
- $option(string)
- Name of the option to update.
- $old_value(mixed)
- The old option value.
- $value(mixed)
- The new option value.
Changelog
Since 2.9.0 | Introduced. |
Where the hook is called
update_option
wp-includes/option.php 923
do_action( 'update_option', $option, $old_value, $value );