pre_update_site_option_(option)
Filters a specific network option before its value is updated.
The dynamic portion of the hook name, $option, refers to the option name.
Usage
add_filter( 'pre_update_site_option_(option)', 'wp_kama_pre_update_site_option_filter', 10, 4 ); /** * Function for `pre_update_site_option_(option)` filter-hook. * * @param mixed $value New value of the network option. * @param mixed $old_value Old value of the network option. * @param string $option Option name. * @param int $network_id ID of the network. * * @return mixed */ function wp_kama_pre_update_site_option_filter( $value, $old_value, $option, $network_id ){ // filter... return $value; }
- $value(mixed)
- New value of the network option.
- $old_value(mixed)
- Old value of the network option.
- $option(string)
- Option name.
- $network_id(int)
- ID of the network.
Changelog
Since 3.0.0 | Introduced. |
Since 2.9.0 | As 'pre_update_site_option_' . $key |
Since 4.4.0 | The $option parameter was added. |
Since 4.7.0 | The $network_id parameter was added. |
Where the hook is called
wp-includes/option.php 2374
$value = apply_filters( "pre_update_site_option_{$option}", $value, $old_value, $option, $network_id );