pre_update_option filter-hook . WP 3.9.0
Filters an option before its value is (maybe) serialized and updated.
Usage
add_filter( 'pre_update_option', 'filter_function_name_5813', 10, 3 ); function filter_function_name_5813( $value, $option, $old_value ){ // filter... return $value; }
- $value(mixed)
- The new, unserialized option value.
- $option(string)
- Name of the option.
- $old_value(mixed)
- The old option value.
Changelog
Since 3.9.0 | Introduced. |
Where the hook is called
pre_update_option
wp-includes/option.php 395
$value = apply_filters( 'pre_update_option', $value, $option, $old_value );
Where in WP core the hook is used WordPress
wp-includes/class-wp-customize-widgets.php 1963
add_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10, 3 );
wp-includes/class-wp-customize-widgets.php 2021
remove_filter( 'pre_update_option', array( $this, 'capture_filter_pre_update_option' ), 10 );