Make WordPress Core


Ignore:
Timestamp:
10/19/2016 04:46:14 AM (8 years ago)
Author:
jeremyfelt
Message:

Multisite: Use get_network() and get_current_network_id() for current network data.

get_network() falls back to the current network when called without any arguments. Between this and get_current_network_id(), we can replace almost all instances of the global $current_site and all instances of get_current_site().

This effectively deprecates get_current_site(), something that we'll do in a future ticket.

Props flixos90.
Fixes #37414.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r38591 r38814  
    162162
    163163        $first_post = sprintf( $first_post,
    164             sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_current_site()->site_name )
     164            sprintf( '<a href="%s">%s</a>', esc_url( network_home_url() ), get_network()->site_name )
    165165        );
    166166
    167167        // Back-compat for pre-4.4
    168168        $first_post = str_replace( 'SITE_URL', esc_url( network_home_url() ), $first_post );
    169         $first_post = str_replace( 'SITE_NAME', get_current_site()->site_name, $first_post );
     169        $first_post = str_replace( 'SITE_NAME', get_network()->site_name, $first_post );
    170170    } else {
    171171        $first_post = __( 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!' );
Note: See TracChangeset for help on using the changeset viewer.