Ticket #14953: switch_to_blog and restore_current_blog inline docs.diff
File switch_to_blog and restore_current_blog inline docs.diff, 1.5 KB (added by , 15 years ago) |
---|
-
wp-includes/ms-blogs.php
370 370 wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options'); 371 371 } 372 372 373 /** 374 * Switches the blog (also referred to as a site) currently in use 375 * by WordPress. 376 * 377 * Beware: If you are running a WP Object cache you may find some 378 * options retain their values from the old blog, you could hook 379 * the switch_blog action and delete or switch caches to 380 * address this. 381 * 382 * @since 3.0.0 383 * 384 * @param int $blog_id The ID of the blog/site to switch to 385 * @param bool $validate Whether to check the existence of the blog before switching 386 * @uses get_blog_details() If validation is required 387 * @uses $wpdb To change the DB tables being queried 388 * @return bool True if the switch was successful, otherwise false 389 **/ 373 390 function switch_to_blog( $new_blog, $validate = false ) { 374 391 global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; 375 392 … … 432 449 return true; 433 450 } 434 451 452 /** 453 * Restores the previous blog (also referred to as a site) that was in use 454 * by WordPress. 455 * 456 * @since 3.0.0 457 * 458 * @uses $wpdb To change the DB tables being queried 459 * @return bool True if the restoration has been successful, otherwise false 460 **/ 435 461 function restore_current_blog() { 436 462 global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache; 437 463