add option to validate on switch_to_blog, see #12023

git-svn-id: http://svn.automattic.com/wordpress/trunk@13047 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
wpmuguru 2010-02-10 17:50:26 +00:00
parent a35ead034f
commit f88db3571a
1 changed files with 4 additions and 1 deletions

View File

@ -310,12 +310,15 @@ function update_blog_option( $id, $key, $value, $refresh = true ) {
wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options');
}
function switch_to_blog( $new_blog ) {
function switch_to_blog( $new_blog, $validate = false ) {
global $wpdb, $table_prefix, $blog_id, $switched, $switched_stack, $wp_roles, $current_user, $wp_object_cache;
if ( empty($new_blog) )
$new_blog = $blog_id;
if ( $validate && ! get_blog_details( $new_blog ) )
return false;
if ( empty($switched_stack) )
$switched_stack = array();