Changeset 18662
- Timestamp:
- 09/11/2011 06:53:09 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/ms-blogs.php
r18601 r18662 321 321 * @uses apply_filters() Calls 'blog_option_$optionname' with the option name value. 322 322 * 323 * @param int $blog_id is the id of theblog.323 * @param int $blog_id Optional. Blog ID, can be null to refer to the current blog. 324 324 * @param string $setting Name of option to retrieve. Should already be SQL-escaped. 325 325 * @param string $default (optional) Default value returned if option not found. … … 328 328 function get_blog_option( $blog_id, $setting, $default = false ) { 329 329 global $wpdb; 330 331 if ( null === $blog_id ) 332 $blog_id = $wpdb->blogid; 330 333 331 334 $key = $blog_id . '-' . $setting . '-blog_option'; … … 381 384 * @param string $key The option key 382 385 * @param mixed $value The option value 386 * @return bool True on success, false on failure. 383 387 */ 384 388 function add_blog_option( $id, $key, $value ) { … … 386 390 387 391 switch_to_blog($id); 388 add_option( $key, $value );392 $return = add_option( $key, $value ); 389 393 restore_current_blog(); 390 wp_cache_set( $id . '-' . $key . '-blog_option', $value, 'site-options' ); 394 if ( $return ) 395 wp_cache_set( $id . '-' . $key . '-blog_option', $value, 'site-options' ); 396 return $return; 391 397 } 392 398 … … 398 404 * @param int $id The blog id 399 405 * @param string $key The option key 406 * @return bool True on success, false on failure. 400 407 */ 401 408 function delete_blog_option( $id, $key ) { … … 403 410 404 411 switch_to_blog($id); 405 delete_option( $key );412 $return = delete_option( $key ); 406 413 restore_current_blog(); 407 wp_cache_set( $id . '-' . $key . '-blog_option', '', 'site-options' ); 414 if ( $return ) 415 wp_cache_set( $id . '-' . $key . '-blog_option', '', 'site-options' ); 416 return $return; 408 417 } 409 418 … … 416 425 * @param string $key The option key 417 426 * @param mixed $value The option value 427 * @return bool True on success, false on failrue. 418 428 */ 419 429 function update_blog_option( $id, $key, $value, $deprecated = null ) { … … 424 434 425 435 switch_to_blog($id); 426 update_option( $key, $value );436 $return = update_option( $key, $value ); 427 437 restore_current_blog(); 428 438 429 439 refresh_blog_details( $id ); 430 440 431 wp_cache_set( $id . '-' . $key . '-blog_option', $value, 'site-options'); 441 if ( $return ) 442 wp_cache_set( $id . '-' . $key . '-blog_option', $value, 'site-options'); 443 return $return; 432 444 } 433 445
Note: See TracChangeset
for help on using the changeset viewer.