WordPress.org

Make WordPress Core

Ticket #25158: 25158.5.diff

File 25158.5.diff, 1.3 KB (added by SergeyBiryukov, 7 years ago)
  • src/wp-admin/admin-header.php

     
    1212
    1313// In case admin-header.php is included in a function.
    1414global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version,
    15         $current_site, $update_title, $total_update_count, $parent_file;
     15        $update_title, $total_update_count, $parent_file;
    1616
     17if ( is_multisite() )
     18        $current_site = get_current_site();
     19
    1720// Catch plugins that include admin-header.php before admin.php completes.
    1821if ( empty( $current_screen ) )
    1922        set_current_screen();
  • src/wp-includes/functions.php

     
    33433343 * @return bool True if $network_id is the main network, or if not running multisite.
    33443344 */
    33453345function is_main_network( $network_id = null ) {
    3346         global $current_site, $wpdb;
     3346        global $wpdb;
    33473347
    33483348        if ( ! is_multisite() )
    33493349                return true;
    33503350
    3351         $current_network_id = (int) $current_site->id;
     3351        $current_network_id = (int) get_current_site()->id;
    33523352
    33533353        if ( ! $network_id )
    33543354                $network_id = $current_network_id;