Make WordPress Core

Ticket #37607: 37607.diff

File 37607.diff, 706 bytes (added by jeremyfelt, 5 years ago)
  • src/wp-includes/ms-blogs.php

     
    478478 *
    479479 * @since 4.6.0
    480480 *
    481  * @global WP_Site $current_blog The current site.
    482  *
    483481 * @param WP_Site|int|null $site Optional. Site to retrieve. Default is the current site.
    484482 * @return WP_Site|null The site object or null if not found.
    485483 */
    486484function get_site( &$site = null ) {
    487         global $current_blog;
    488         if ( empty( $site ) && isset( $current_blog ) ) {
    489                 $site = $current_blog;
     485        if ( empty( $site ) ) {
     486                $site = get_current_blog_id();
    490487        }
    491488
    492489        if ( $site instanceof WP_Site ) {