Make WordPress Core

Ticket #14953: ALT switch_to_blog and restore_current_blog inline docs.diff

File ALT switch_to_blog and restore_current_blog inline docs.diff, 2.0 KB (added by simonwheatley, 14 years ago)

Alternative diff, this time with @uses for all functions called within the documented function, is this best practice to list them exhaustively or only where a comment on usage is required/given?

  • Users/simon/Projects/WordPress-Bleeding/site/wp-includes/ms-blogs.php

     
    370370        wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options');
    371371}
    372372
     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 * @uses get_blog_details() If validation is required
     384 * @uses $wpdb To change the DB tables being queried
     385 * @uses do_action()
     386 * @uses did_action()
     387 * @uses wp_get_current_user()
     388 * @uses wp_cache_init()
     389 * @uses wp_cache_add_global_groups()
     390 * @uses wp_cache_add_non_persistent_groups()
     391 *
     392 * @param int $blog_id The ID of the blog/site to switch to
     393 * @param bool $validate Whether to check the existence of the blog before switching
     394 * @return bool True if the switch was successful, otherwise false
     395 **/
    373396function switch_to_blog( $new_blog, $validate = false ) {
    374397        global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
    375398
     
    432455        return true;
    433456}
    434457
     458/**
     459 * Restores the previous blog (also referred to as a site) that was in use
     460 * by WordPress.
     461 *
     462 * @since 3.0.0
     463 * @uses $wpdb To change the DB tables being queried
     464 * @uses do_action()
     465 * @uses did_action()
     466 * @uses wp_get_current_user()
     467 * @uses wp_cache_init()
     468 * @uses wp_cache_add_global_groups()
     469 * @uses wp_cache_add_non_persistent_groups()
     470 *
     471 * @return bool True if the restoration has been successful, otherwise false
     472 **/
    435473function restore_current_blog() {
    436474        global $table_prefix, $wpdb, $blog_id, $switched, $switched_stack, $wp_roles, $wp_object_cache;
    437475