Make WordPress Core


Ignore:
Timestamp:
10/02/2017 01:43:48 AM (7 years ago)
Author:
jeremyfelt
Message:

Multisite: Use get_current_blog_id() instead of $wpdb->blogid.

get_current_blog_id() is more appropriate for determining the ID of the current site in most cases. This eliminates the need for the global $wpdb in several functions and is better than the implicit global used in admin pages.

Props bnap00, spacedmonkey.
Fixes #41684.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/multisite/site.php

    r41380 r41661  
    364364
    365365        // compare the update time with the current time, allow delta < 2
    366         $blog = get_site( $wpdb->blogid );
     366        $blog = get_site( get_current_blog_id() );
    367367        $current_time = time();
    368368        $time_difference = $current_time - strtotime( $blog->last_updated );
Note: See TracChangeset for help on using the changeset viewer.