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/network/users.php

    r38721 r38814  
    7373                                $blogs = get_blogs_of_user( $user_id, true );
    7474                                foreach ( (array) $blogs as $details ) {
    75                                     if ( $details->userblog_id != $current_site->blog_id ) // main blog not a spam !
     75                                    if ( $details->userblog_id != get_network()->site_id ) // main blog not a spam !
    7676                                        update_blog_status( $details->userblog_id, 'spam', '1' );
    7777                                }
Note: See TracChangeset for help on using the changeset viewer.