Make WordPress Core


Ignore:
Timestamp:
09/20/2016 09:38:08 PM (8 years ago)
Author:
jeremyfelt
Message:

Multisite: Revert [38388].

Restore get_current_site() to a multisite only function. Providing this in single site may be a possibility in the future, but should have a dedicated ticket and discussion.

See #37699.

File:
1 edited

Legend:

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

    r38457 r38636  
    13331333 */
    13341334function install_blog( $blog_id, $blog_title = '' ) {
    1335     global $wpdb, $wp_roles;
     1335    global $wpdb, $wp_roles, $current_site;
     1336
    13361337    // Cast for security
    13371338    $blog_id = (int) $blog_id;
     
    13611362            $siteurl = set_url_scheme( $siteurl, 'https' );
    13621363        }
    1363         if ( 'https' === parse_url( get_home_url( get_current_site()->blog_id ), PHP_URL_SCHEME ) ) {
     1364        if ( 'https' === parse_url( get_home_url( $current_site->blog_id ), PHP_URL_SCHEME ) ) {
    13641365            $home = set_url_scheme( $home, 'https' );
    13651366        }
     
    14981499    $message = $welcome_email;
    14991500
    1500     if ( empty( $current_site->site_name ) ) {
     1501    if ( empty( $current_site->site_name ) )
    15011502        $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 */
     1608function get_current_site() {
     1609    global $current_site;
     1610    return $current_site;
    15921611}
    15931612
Note: See TracChangeset for help on using the changeset viewer.