Multisite: Deprecate `is_user_option_local()`.

`is_user_option_local()` was added during MU development and used for a handful of changesets before the code using it was removed again. It has not been used by MU or core since nor is it widely used elsewhere.

Fixes #41697.
Props bnap00, jeremyfelt.


git-svn-id: https://develop.svn.wordpress.org/trunk@41668 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jeremy Felt 2017-10-02 03:37:29 +00:00
parent 3fbb8ed287
commit 28b28b581a
2 changed files with 27 additions and 24 deletions

View File

@ -519,3 +519,30 @@ function wp_get_sites( $args = array() ) {
return $results;
}
/**
* Check whether a usermeta key has to do with the current blog.
*
* @since MU (3.0.0)
* @deprecated 4.9.0
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $key
* @param int $user_id Optional. Defaults to current user.
* @param int $blog_id Optional. Defaults to current blog.
* @return bool
*/
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
global $wpdb;
_deprecated_function( __FUNCTION__, '4.9.0' );
$current_user = wp_get_current_user();
if ( $blog_id == 0 ) {
$blog_id = get_current_blog_id();
}
$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
return isset( $current_user->$local_key );
}

View File

@ -2200,30 +2200,6 @@ function update_blog_public( $old_value, $value ) {
update_blog_status( get_current_blog_id(), 'public', (int) $value );
}
/**
* Check whether a usermeta key has to do with the current blog.
*
* @since MU (3.0.0)
*
* @global wpdb $wpdb WordPress database abstraction object.
*
* @param string $key
* @param int $user_id Optional. Defaults to current user.
* @param int $blog_id Optional. Defaults to current blog.
* @return bool
*/
function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
global $wpdb;
$current_user = wp_get_current_user();
if ( $blog_id == 0 ) {
$blog_id = get_current_blog_id();
}
$local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
return isset( $current_user->$local_key );
}
/**
* Check whether users can self-register, based on Network settings.
*