WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/31/2016 04:55:01 AM (3 years ago)
Author:
wonderboymusic
Message:

Multisite: use get_current_blog_id() where applicable, in lieu of plucking the $blog_id global from outer space.

See #37699.

File:
1 edited

Legend:

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

    r38343 r38457  
    23582358 *
    23592359 * @global wpdb $wpdb    WordPress database abstraction object.
    2360  * @global int  $blog_id The site ID of the site for those that use more than one site.
    23612360 *
    23622361 * @param int $id Site ID.
     
    23662365    _deprecated_function( __FUNCTION__, '3.1.0', 'get_users()' );
    23672366
    2368     global $wpdb, $blog_id;
    2369     if ( empty($id) )
    2370         $id = (int) $blog_id;
     2367    global $wpdb;
     2368    if ( empty( $id ) ) {
     2369        $id = get_current_blog_id();
     2370    }
    23712371    $blog_prefix = $wpdb->get_blog_prefix($id);
    23722372    $users = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" );
Note: See TracChangeset for help on using the changeset viewer.