default_site_option_(option)
Filters the value of a specific default network option.
The dynamic portion of the hook name, $option, refers to the option name.
Usage
add_filter( 'default_site_option_(option)', 'wp_kama_default_site_option_filter', 10, 3 ); /** * Function for `default_site_option_(option)` filter-hook. * * @param mixed $default_value The value to return if the site option does not exist in the database. * @param string $option Option name. * @param int $network_id ID of the network. * * @return mixed */ function wp_kama_default_site_option_filter( $default_value, $option, $network_id ){ // filter... return $default_value; }
- $default_value(mixed)
- The value to return if the site option does not exist in the database.
- $option(string)
- Option name.
- $network_id(int)
- ID of the network.
Changelog
Since 3.4.0 | Introduced. |
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 1802
return apply_filters( "default_site_option_{$option}", $default_value, $option, $network_id );
wp-includes/option.php 1807
$default_value = apply_filters( 'default_site_option_' . $option, $default_value, $option, $network_id );
wp-includes/option.php 1830
$value = apply_filters( 'default_site_option_' . $option, $default_value, $option, $network_id );
Where the hook is used in WordPress
wp-includes/ms-default-constants.php 20
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
wp-includes/ms-default-filters.php 130
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );