default_site_option_{$option}
Filter HookDescription
Filters the value of a specific default network option. The dynamic portion of the hook name, `$option`, refers to the option name.Hook Information
File Location |
wp-includes/option.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2064 |
Hook Parameters
Type | Name | Description |
---|---|---|
mixed
|
$default_value
|
The value to return if the site option does not exist in the database. |
string
|
$option
|
Option name. |
int
|
$network_id
|
ID of the network. |
Usage Examples
Basic Usage
<?php
// Hook into default_site_option_{$option}
add_filter('default_site_option_{$option}', 'my_custom_filter', 10, 3);
function my_custom_filter($default_value, $option, $network_id) {
// Your custom filtering logic here
return $default_value;
}
Source Code Context
wp-includes/option.php:2064
- How this hook is used in WordPress core
<?php
2059 * @param mixed $default_value The value to return if the site option does not exist
2060 * in the database.
2061 * @param string $option Option name.
2062 * @param int $network_id ID of the network.
2063 */
2064 return apply_filters( "default_site_option_{$option}", $default_value, $option, $network_id );
2065 }
2066
2067 if ( ! is_multisite() ) {
2068 /** This filter is documented in wp-includes/option.php */
2069 $default_value = apply_filters( 'default_site_option_' . $option, $default_value, $option, $network_id );
PHP Documentation
<?php
/**
* Filters the value of a specific default network option.
*
* The dynamic portion of the hook name, `$option`, refers to the option name.
*
* @since 3.4.0
* @since 4.4.0 The `$option` parameter was added.
* @since 4.7.0 The `$network_id` parameter was added.
*
* @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.
*/
Quick Info
- Hook Type: Filter
- Parameters: 3
- File: wp-includes/option.php
Related Hooks
Related hooks will be displayed here in future updates.