Make WordPress Core


Ignore:
Timestamp:
08/26/2016 09:34:36 PM (9 years ago)
Author:
wonderboymusic
Message:

Multisite: move get_current_site() to load.php so that it can be used in more places, instead of importing global $current_site.

See #37699.

File:
1 edited

Legend:

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

    r38201 r38388  
    13331333 */
    13341334function install_blog( $blog_id, $blog_title = '' ) {
    1335     global $wpdb, $wp_roles, $current_site;
    1336 
     1335    global $wpdb, $wp_roles;
    13371336    // Cast for security
    13381337    $blog_id = (int) $blog_id;
     
    13621361            $siteurl = set_url_scheme( $siteurl, 'https' );
    13631362        }
    1364         if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) {
     1363        if ( 'https' === parse_url( get_home_url( get_current_site()->blog_id ), PHP_URL_SCHEME ) ) {
    13651364            $home = set_url_scheme( $home, 'https' );
    13661365        }
     
    14991498    $message = $welcome_email;
    15001499
    1501     if ( empty( $current_site->site_name ) )
     1500    if ( empty( $current_site->site_name ) ) {
    15021501        $current_site->site_name = 'WordPress';
     1502    }
    15031503
    15041504    /**
     
    15901590    wp_mail( $user->user_email, wp_specialchars_decode( $subject ), $message, $message_headers );
    15911591    return true;
    1592 }
    1593 
    1594 /**
    1595  * Get the current network.
    1596  *
    1597  * Returns an object containing the 'id', 'domain', 'path', and 'site_name'
    1598  * properties of the network being viewed.
    1599  *
    1600  * @see wpmu_current_site()
    1601  *
    1602  * @since MU
    1603  *
    1604  * @global WP_Network $current_site
    1605  *
    1606  * @return WP_Network
    1607  */
    1608 function get_current_site() {
    1609     global $current_site;
    1610     return $current_site;
    16111592}
    16121593
Note: See TracChangeset for help on using the changeset viewer.