pre_add_site_option_(option) filter-hookWP 3.0.0

Filters the value of a specific network option before it is added.

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


add_filter( 'pre_add_site_option_(option)', 'wp_kama_pre_add_site_option_filter', 10, 3 );

 * Function for `pre_add_site_option_(option)` filter-hook.
 * @param mixed  $value      Value of network option.
 * @param string $option     Option name.
 * @param int    $network_id ID of the network.
 * @return mixed
function wp_kama_pre_add_site_option_filter( $value, $option, $network_id ){

	// filter...
	return $value;
Value of network option.
Option name.
ID of the network.


Since 3.0.0 Introduced.
Since 2.9.0 As 'pre_add_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 1903
$value = apply_filters( "pre_add_site_option_{$option}", $value, $option, $network_id );

Where the hook is used in WordPress

Usage not found.