From 5ccf8eebb7ebf2e54d3ff3ec66338a7c9838895c Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Mon, 2 Oct 2017 03:38:45 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@41668 git-svn-id: http://core.svn.wordpress.org/trunk@41502 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-deprecated.php | 27 +++++++++++++++++++++++++++ wp-includes/ms-functions.php | 24 ------------------------ wp-includes/version.php | 2 +- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index cba5f1e57b..37fb310bb6 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -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 ); +} diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index f70deb4e57..1aac0d20b1 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -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. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 0a3130d7c5..d1706e2474 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9-alpha-41667'; +$wp_version = '4.9-alpha-41668'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.