Make WordPress Core

Changeset 13047


Ignore:
Timestamp:
02/10/2010 05:50:26 PM (15 years ago)
Author:
wpmuguru
Message:

add option to validate on switch_to_blog, see #12023

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r12954 r13047  
    311311}
    312312
    313 function switch_to_blog( $new_blog ) {
     313function switch_to_blog( $new_blog, $validate = false ) {
    314314    global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache;
    315315
    316316    if ( empty($new_blog) )
    317317        $new_blog = $blog_id;
     318
     319    if ( $validate && ! get_blog_details( $new_blog ) )
     320        return false;
    318321
    319322    if ( empty($switched_stack) )
Note: See TracChangeset for help on using the changeset viewer.