site_option_(option)
Filters the value of an existing network option.
The dynamic portion of the hook name, $option, refers to the option name.
Использование
add_filter( 'site_option_(option)', 'wp_kama_site_option_filter', 10, 3 );
/**
* Function for `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_site_option_filter( $value, $option, $network_id ){
// filter...
return $value;
}
- $value(разное)
- Value of network option.
- $option(строка)
- Option name.
- $network_id(int)
- ID of the network.
Список изменений
| С версии 3.0.0 | Введена. |
| С версии 2.9.0 | As 'site_option_' . $key |
| С версии 4.4.0 | The $option parameter was added. |
| С версии 4.7.0 | The $network_id parameter was added. |
Где вызывается хук
wp-includes/option.php 2135
return apply_filters( "site_option_{$option}", $value, $option, $network_id );
Где используется хук в WordPress
wp-includes/ms-default-filters.php 21
add_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );
wp-includes/ms-functions.php 2396
remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' );