Make WordPress Core

Ticket #16702: 16702.2.patch

File 16702.2.patch, 1.8 KB (added by SergeyBiryukov, 13 years ago)

Move into ms-deprecated.php instead of deprecated.php

  • wp-includes/ms-deprecated.php

     
    200200        }
    201201        return array_slice( $most_active, 0, $num );
    202202}
     203
     204/**
     205 * Checks if the current user belongs to a given blog. No longer used in core.
     206 *
     207 * @since MU
     208 * @deprecated 3.3.0
     209 * @deprecated Use get_blogs_of_user()
     210 * @see get_blogs_of_user()
     211 *
     212 * @param int $blog_id Blog ID
     213 * @return bool True if the current user belongs to $blog_id, false if not.
     214 */
     215function is_blog_user( $blog_id = 0 ) {
     216        _deprecated_function( __FUNCTION__, '3.3' );
     217
     218        global $wpdb;
     219
     220        $current_user = wp_get_current_user();
     221        if ( !$blog_id )
     222                $blog_id = $wpdb->blogid;
     223
     224        $cap_key = $wpdb->get_blog_prefix( $blog_id ) . 'capabilities';
     225
     226        if ( is_array( $current_user->$cap_key ) && in_array( 1, $current_user->$cap_key ) )
     227                return true;
     228
     229        return false;
     230}
    203231?>
  • wp-includes/user.php

     
    717717}
    718718
    719719/**
    720  * Checks if the current user belong to a given blog.
    721  *
    722  * @since 3.0.0
    723  *
    724  * @param int $blog_id Blog ID
    725  * @return bool True if the current users belong to $blog_id, false if not.
    726  */
    727 function is_blog_user( $blog_id = 0 ) {
    728         global $wpdb;
    729 
    730         $current_user = wp_get_current_user();
    731         if ( !$blog_id )
    732                 $blog_id = $wpdb->blogid;
    733 
    734         $cap_key = $wpdb->base_prefix . $blog_id . '_capabilities';
    735 
    736         if ( is_array($current_user->$cap_key) && in_array(1, $current_user->$cap_key) )
    737                 return true;
    738 
    739         return false;
    740 }
    741 
    742 /**
    743720 * Add meta data field to a user.
    744721 *
    745722 * Post meta data is called "Custom Fields" on the Administration Screens.