Deprecate and ignore the refresh arg. fixes #15605

git-svn-id: http://svn.automattic.com/wordpress/trunk@16673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-12-01 22:12:09 +00:00
parent 92c2b40e0b
commit 0eeb985ef2
2 changed files with 17 additions and 12 deletions

View File

@ -432,13 +432,15 @@ function upload_space_setting( $id ) {
} }
add_action( 'wpmueditblogaction', 'upload_space_setting' ); 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; global $wpdb;
if ( null !== $deprecated )
_deprecated_argument( __FUNCTION__, '3.1.0' );
$wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) ); $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) );
if ( $refresh == 1 ) clean_user_cache( $id );
refresh_user_details( $id );
if ( $pref == 'spam' ) { if ( $pref == 'spam' ) {
if ( $value == 1 ) if ( $value == 1 )

View File

@ -300,7 +300,7 @@ function update_blog_details( $blog_id, $details = array() ) {
} }
if ( isset($details[ 'public' ]) ) 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); refresh_blog_details($blog_id);
@ -421,17 +421,19 @@ function delete_blog_option( $id, $key ) {
* @param int $id The blog id * @param int $id The blog id
* @param string $key The option key * @param string $key The option key
* @param mixed $value The option value * @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; $id = (int) $id;
if ( null !== $deprecated )
_deprecated_argument( __FUNCTION__, '3.1.0' );
switch_to_blog($id); switch_to_blog($id);
update_option( $key, $value ); update_option( $key, $value );
restore_current_blog(); restore_current_blog();
if ( $refresh == true ) refresh_blog_details( $id );
refresh_blog_details( $id );
wp_cache_set( $id."-".$key."-blog_option", $value, 'site-options'); 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 int $blog_id BLog ID
* @param string $pref A field name * @param string $pref A field name
* @param string $value Value for $pref * @param string $value Value for $pref
* @param bool $refresh Whether to refresh the blog details cache. Default is true.
* @return string $value * @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; 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') ) ) if ( !in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) )
return $value; return $value;
$wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) ); $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 ) if ( 'spam' == $pref )
( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id ); ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id );