default_site_option_(option) хук-фильтрWP 3.4.0

Filters a specific default network option.

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

Использование

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    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, $option, $network_id ){

	// filter...
	return $default;
}
$default(разное)
The value to return if the site option does not exist in the database.
$option(строка)
Option name.
$network_id(int)
ID of the network.

Список изменений

С версии 3.4.0 Введена.
С версии 4.4.0 The $option parameter was added.
С версии 4.7.0 The $network_id parameter was added.

Где вызывается хук

get_network_option()
default_site_option_(option)
wp-includes/option.php 1436
return apply_filters( "default_site_option_{$option}", $default, $option, $network_id );
wp-includes/option.php 1441
$default = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );
wp-includes/option.php 1464
$value = apply_filters( 'default_site_option_' . $option, $default, $option, $network_id );

Где используется хук в WordPress

wp-includes/ms-default-constants.php 20
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );
wp-includes/ms-default-filters.php 131
add_filter( 'default_site_option_ms_files_rewriting', '__return_true' );