Filter hook 'default_site_option_'

in WP Core File wp-includes/option.php at line 2092

View Source

default_site_option_

Filter Hook
Description
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 2092

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_
add_filter('default_site_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:2092 - How this hook is used in WordPress core
<?php
2087  
2088  				$notoptions[ $option ] = true;
2089  				wp_cache_set( $notoptions_key, $notoptions, 'site-options' );
2090  
2091  				/** This filter is documented in wp-includes/option.php */
2092  				$value = apply_filters( 'default_site_option_' . $option, $default_value, $option, $network_id );
2093  			}
2094  		}
2095  	}
2096  
2097  	if ( ! is_array( $notoptions ) ) {

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.