pre_update_option_(option) filter-hookWP 2.6.0

Filters a specific option before its value is (maybe) serialized and updated.

The dynamic portion of the hook name, $option, refers to the option name.

Usage

add_filter( 'pre_update_option_(option)', 'wp_kama_pre_update_option_filter', 10, 3 );

/**
 * Function for `pre_update_option_(option)` filter-hook.
 * 
 * @param mixed  $value     The new, unserialized option value.
 * @param mixed  $old_value The old option value.
 * @param string $option    Option name.
 *
 * @return mixed
 */
function wp_kama_pre_update_option_filter( $value, $old_value, $option ){

	// filter...
	return $value;
}
$value(mixed)
The new, unserialized option value.
$old_value(mixed)
The old option value.
$option(string)
Option name.

Changelog

Since 2.6.0 Introduced.
Since 4.4.0 The $option parameter was added.

Where the hook is called

update_option()
pre_update_option_(option)
wp-includes/option.php 439
$value = apply_filters( "pre_update_option_{$option}", $value, $old_value, $option );

Where the hook is used in WordPress

Usage not found.