WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/12/2017 01:10:24 PM (3 years ago)
Author:
flixos90
Message:

Multisite: Remove references to $wpdb->siteid and use get_current_network_id() instead.

Props sathyapulse, spacedmonkey.
Fixes #41507.

File:
1 edited

Legend:

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

    r41241 r41242  
    188188
    189189    global $wpdb;
    190     $blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
     190    $blogs = $wpdb->get_results( $wpdb->prepare( "SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", get_current_network_id() ), ARRAY_A );
    191191
    192192    $blog_list = array();
     
    431431
    432432    if ( ! $domain )
    433         $network_id = $wpdb->siteid;
     433        $network_id = get_current_network_id();
    434434    else
    435435        $network_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM $wpdb->site WHERE domain = %s AND path = %s", $domain, $path ) );
     
    447447 * @deprecated 4.6.0 Use get_sites()
    448448 * @see get_sites()
    449  *
    450  * @global wpdb $wpdb WordPress database abstraction object.
    451449 *
    452450 * @param array $args {
     
    469467 */
    470468function wp_get_sites( $args = array() ) {
    471     global $wpdb;
    472 
    473469    _deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );
    474470
     
    477473
    478474    $defaults = array(
    479         'network_id' => $wpdb->siteid,
     475        'network_id' => get_current_network_id(),
    480476        'public'     => null,
    481477        'archived'   => null,
Note: See TracChangeset for help on using the changeset viewer.