WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
3718 | * @param string $option Name of option to retrieve. Expected to not be SQL-escaped. |
3719 | * @param mixed $default Optional value to return if option doesn't exist. Default false. |
3720 | * @param bool $use_cache Whether to use cache. Multisite only. Default true. |
3721 | * @return mixed Value set for the option. |
3722 | */ |
3723 | function get_site_option( $option, $default = false, $use_cache = true ) { |
3724 | global $wpdb; |
3725 |
|
3726 | // Allow plugins to short-circuit site options. |
3727 | $pre = apply_filters( 'pre_site_option_' . $option, false ); |
3728 | if ( false !== $pre ) |
3729 | return $pre; |
3730 |
|
3731 | if ( !is_multisite() ) { |
3732 | $value = get_option($option, $default); |
3733 | } else { |
3734 | $cache_key = "{$wpdb->siteid}:$option"; |
3735 | if ( $use_cache ) |
3736 | $value = wp_cache_get($cache_key, 'site-options'); |