Make WordPress Core

Ticket #41697: 41697.diff

File 41697.diff, 1.9 KB (added by jeremyfelt, 8 years ago)
  • src/wp-includes/ms-deprecated.php

     
    519519
    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}
  • src/wp-includes/ms-functions.php

     
    22012201}
    22022202
    22032203/**
    2204  * Check whether a usermeta key has to do with the current blog.
    2205  *
    2206  * @since MU (3.0.0)
    2207  *
    2208  * @global wpdb $wpdb WordPress database abstraction object.
    2209  *
    2210  * @param string $key
    2211  * @param int    $user_id Optional. Defaults to current user.
    2212  * @param int    $blog_id Optional. Defaults to current blog.
    2213  * @return bool
    2214  */
    2215 function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) {
    2216         global $wpdb;
    2217 
    2218         $current_user = wp_get_current_user();
    2219         if ( $blog_id == 0 ) {
    2220                 $blog_id = get_current_blog_id();
    2221         }
    2222         $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key;
    2223 
    2224         return isset( $current_user->$local_key );
    2225 }
    2226 
    2227 /**
    22282204 * Check whether users can self-register, based on Network settings.
    22292205 *
    22302206 * @since MU (3.0.0)