From 94a82dbfcd3f918bb53d664f05ba6458f3e235c2 Mon Sep 17 00:00:00 2001 From: donncha Date: Thu, 29 Mar 2007 12:22:20 +0000 Subject: Update site option if it's already there in add_site_option delete user cache when they're added to a blog git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@953 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-includes/wpmu-functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'wp-includes') diff --git a/wp-includes/wpmu-functions.php b/wp-includes/wpmu-functions.php index 538d0f4..bf13d16 100644 --- a/wp-includes/wpmu-functions.php +++ b/wp-includes/wpmu-functions.php @@ -254,8 +254,10 @@ function add_site_option( $key, $value ) { $exists = $wpdb->get_var("SELECT meta_value FROM $wpdb->sitemeta WHERE meta_key = '$key' AND site_id = '{$wpdb->siteid}'"); - if ( null !== $exists ) // If we already have it + if ( null !== $exists ) {// If we already have it + update_site_option( $key, $value ); return false; + } if ( is_array($value) || is_object($value) ) $value = serialize($value); @@ -660,6 +662,8 @@ function add_user_to_blog( $blog_id, $user_id, $role ) { do_action('add_user_to_blog', $user_id, $role, $blog_id); + wp_cache_delete( $user_id, 'users' ); + restore_current_blog(); } -- cgit