WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/19/2016 04:46:14 AM (3 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/admin-header.php

    r38705 r38814  
    3434
    3535if ( is_network_admin() )
    36     $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_current_site()->site_name ) );
     36    $admin_title = sprintf( __( 'Network Admin: %s' ), esc_html( get_network()->site_name ) );
    3737elseif ( is_user_admin() )
    38     $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_current_site()->site_name ) );
     38    $admin_title = sprintf( __( 'User Dashboard: %s' ), esc_html( get_network()->site_name ) );
    3939else
    4040    $admin_title = get_bloginfo( 'name' );
Note: See TracChangeset for help on using the changeset viewer.