Deprecate and ignore the refresh arg. fixes #15605
git-svn-id: https://develop.svn.wordpress.org/trunk@16673 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
71ec2d33de
commit
14a1be89f6
|
@ -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 )
|
||||||
|
|
|
@ -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,18 +616,19 @@ 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 )
|
||||||
|
|
Loading…
Reference in New Issue