Changeset 13116
- Timestamp:
- 02/13/2010 06:56:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-functions.php
r13106 r13116 251 251 $value = wp_cache_get( $key, "site-options" ); 252 252 if ( $value == null ) { 253 $blog_prefix = $wpdb->get_blog_prefix( $blog_id ); 254 $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$blog_prefix}options WHERE option_name = %s", $setting ) ); 255 if ( is_object( $row ) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values 256 $value = $row->option_value; 257 if ( $value == false ) 253 if ( $blog_id == $wpdb->blogid ) { 254 $value = get_option( $setting, $default ); 255 $notoptions = wp_cache_get( 'notoptions', 'options' ); 256 if ( isset( $notoptions[$setting] ) ) 257 wp_cache_set( $key, 'noop', 'site-options' ); 258 elseif ( $value == false ) 258 259 wp_cache_set( $key, 'falsevalue', 'site-options' ); 259 260 else 260 261 wp_cache_set( $key, $value, 'site-options' ); 261 } else { // option does not exist, so we must cache its non-existence 262 wp_cache_set( $key, 'noop', 'site-options' ); 263 $value = $default; 262 } else { 263 $blog_prefix = $wpdb->get_blog_prefix( $blog_id ); 264 $row = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$blog_prefix}options WHERE option_name = %s", $setting ) ); 265 if ( is_object( $row ) ) { // Has to be get_row instead of get_var because of funkiness with 0, false, null values 266 $value = $row->option_value; 267 if ( $value == false ) 268 wp_cache_set( $key, 'falsevalue', 'site-options' ); 269 else 270 wp_cache_set( $key, $value, 'site-options' ); 271 } else { // option does not exist, so we must cache its non-existence 272 wp_cache_set( $key, 'noop', 'site-options' ); 273 $value = $default; 274 } 264 275 } 265 276 } elseif ( $value == 'noop' ) {
Note: See TracChangeset
for help on using the changeset viewer.