### Eclipse Workspace Patch 1.0
#P wordpress-trunk
|
|
|
3158 | 3158 | } |
3159 | 3159 | |
3160 | 3160 | function get_site_option( $key, $default = false, $use_cache = true ) { |
3161 | | return get_option($key, $default); |
| 3161 | // Allow plugins to short-circuit site options. |
| 3162 | $pre = apply_filters( 'pre_site_option_' . $key, false ); |
| 3163 | if ( false !== $pre ) |
| 3164 | return $pre; |
| 3165 | |
| 3166 | $value = get_option($key, $default); |
| 3167 | |
| 3168 | return apply_filters( 'site_option_' . $key, $value ); |
3162 | 3169 | } |
3163 | 3170 | |
3164 | 3171 | // expects $key, $value not to be SQL escaped |
3165 | 3172 | function add_site_option( $key, $value ) { |
3166 | | return add_option($key, $value); |
| 3173 | $value = apply_filters( 'pre_add_site_option_' . $key, $value ); |
| 3174 | $result = add_option($key, $value); |
| 3175 | do_action( "add_site_option_{$key}", $key, $value ); |
| 3176 | return $result; |
3167 | 3177 | } |
3168 | 3178 | |
3169 | 3179 | // expects $key, $value not to be SQL escaped |
3170 | 3180 | function update_site_option( $key, $value ) { |
3171 | | return update_option($key, $value); |
| 3181 | $oldvalue = get_site_option( $key ); |
| 3182 | $value = apply_filters( 'pre_update_site_option_' . $key, $value, $oldvalue ); |
| 3183 | $result = update_option($key, $value); |
| 3184 | do_action( "update_site_option_{$key}", $key, $value ); |
| 3185 | return $result; |
3172 | 3186 | } |
3173 | 3187 | |
3174 | 3188 | /** |