Action hook 'updated_option'

in WP Core File wp-includes/option.php at line 1031

View Source

updated_option

Action Hook
Description
Fires after the value of an option has been successfully updated.

Hook Information

File Location wp-includes/option.php View on GitHub
Hook Type Action
Line Number 1031

Hook Parameters

Type Name Description
string $option Name of the updated option.
mixed $old_value The old option value.
mixed $value The new option value.

Usage Examples

Basic Usage
<?php
// Hook into updated_option
add_action('updated_option', 'my_custom_function', 10, 3);

function my_custom_function($option, $old_value, $value) {
    // Your custom code here
}

Source Code Context

wp-includes/option.php:1031 - How this hook is used in WordPress core
<?php
1026  	 *
1027  	 * @param string $option    Name of the updated option.
1028  	 * @param mixed  $old_value The old option value.
1029  	 * @param mixed  $value     The new option value.
1030  	 */
1031  	do_action( 'updated_option', $option, $old_value, $value );
1032  
1033  	return true;
1034  }
1035  
1036  /**

PHP Documentation

<?php
/**
	 * Fires after the value of an option has been successfully updated.
	 *
	 * @since 2.9.0
	 *
	 * @param string $option    Name of the updated option.
	 * @param mixed  $old_value The old option value.
	 * @param mixed  $value     The new option value.
	 */
Quick Info
  • Hook Type: Action
  • Parameters: 3
  • File: wp-includes/option.php
Related Hooks

Related hooks will be displayed here in future updates.