From 0eeb985ef2cebf74126d8e1caf46d9e836bdf66d Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 1 Dec 2010 22:12:09 +0000 Subject: [PATCH] Deprecate and ignore the refresh arg. fixes #15605 git-svn-id: http://svn.automattic.com/wordpress/trunk@16673 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/ms.php | 8 +++++--- wp-includes/ms-blogs.php | 21 ++++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 777989c8e..99bd90916 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -432,13 +432,15 @@ function upload_space_setting( $id ) { } add_action( 'wpmueditblogaction', 'upload_space_setting' ); -function update_user_status( $id, $pref, $value, $refresh = 1 ) { +function update_user_status( $id, $pref, $value, $deprecated = null ) { global $wpdb; + if ( null !== $deprecated ) + _deprecated_argument( __FUNCTION__, '3.1.0' ); + $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) ); - if ( $refresh == 1 ) - refresh_user_details( $id ); + clean_user_cache( $id ); if ( $pref == 'spam' ) { if ( $value == 1 ) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index abdd55e40..95fe3f1e4 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -300,7 +300,7 @@ function update_blog_details( $blog_id, $details = array() ) { } if ( isset($details[ 'public' ]) ) - update_blog_option( $blog_id, 'blog_public', $details[ 'public' ], false ); + update_blog_option( $blog_id, 'blog_public', $details[ 'public' ] ); refresh_blog_details($blog_id); @@ -421,17 +421,19 @@ function delete_blog_option( $id, $key ) { * @param int $id The blog id * @param string $key The option key * @param mixed $value The option value - * @param bool $refresh Whether to refresh blog details or not */ -function update_blog_option( $id, $key, $value, $refresh = true ) { +function update_blog_option( $id, $key, $value, $deprecated = null ) { $id = (int) $id; + if ( null !== $deprecated ) + _deprecated_argument( __FUNCTION__, '3.1.0' ); + switch_to_blog($id); update_option( $key, $value ); restore_current_blog(); - if ( $refresh == true ) - refresh_blog_details( $id ); + refresh_blog_details( $id ); + wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options'); } @@ -614,19 +616,20 @@ function update_archived( $id, $archived ) { * @param int $blog_id BLog ID * @param string $pref A field name * @param string $value Value for $pref - * @param bool $refresh Whether to refresh the blog details cache. Default is true. * @return string $value */ -function update_blog_status( $blog_id, $pref, $value, $refresh = true ) { +function update_blog_status( $blog_id, $pref, $value, $deprecated = null ) { global $wpdb; + if ( null !== $deprecated ) + _deprecated_argument( __FUNCTION__, '3.1.0' ); + if ( !in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) ) return $value; $wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) ); - if ( $refresh ) - refresh_blog_details($blog_id); + refresh_blog_details($blog_id); if ( 'spam' == $pref ) ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id );