Make WordPress Core


Ignore:
Timestamp:
10/02/2017 03:37:29 AM (6 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-deprecated.php

    r41664 r41668  
    520520    return $results;
    521521}
     522
     523/**
     524 * Check whether a usermeta key has to do with the current blog.
     525 *
     526 * @since MU (3.0.0)
     527 * @deprecated 4.9.0
     528 *
     529 * @global wpdb $wpdb WordPress database abstraction object.
     530 *
     531 * @param string $key
     532 * @param int    $user_id Optional. Defaults to current user.
     533 * @param int    $blog_id Optional. Defaults to current blog.
     534 * @return bool
     535 */
     536function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
     537    global $wpdb;
     538
     539    _deprecated_function( __FUNCTION__, '4.9.0' );
     540
     541    $current_user = wp_get_current_user();
     542    if ( $blog_id == 0 ) {
     543        $blog_id = get_current_blog_id();
     544    }
     545    $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
     546
     547    return isset( $current_user->$local_key );
     548}
Note: See TracChangeset for help on using the changeset viewer.