mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
Multisite: Remove references to $wpdb->siteid and use get_current_network_id() instead.
Props sathyapulse, spacedmonkey. Fixes #41507. git-svn-id: https://develop.svn.wordpress.org/trunk@41242 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -189,16 +189,7 @@ class Tests_Multisite_Network extends WP_UnitTestCase {
|
||||
* @ticket 37865
|
||||
*/
|
||||
public function test_get_blog_count_on_different_network() {
|
||||
global $current_site, $wpdb;
|
||||
|
||||
// switch_to_network()...
|
||||
$orig_network_id = $current_site->id;
|
||||
$orig_wpdb_network_id = $wpdb->siteid;
|
||||
$current_site->id = self::$different_network_id;
|
||||
$wpdb->siteid = self::$different_network_id;
|
||||
wp_update_network_site_counts();
|
||||
$current_site->id = $orig_network_id;
|
||||
$wpdb->siteid = $orig_wpdb_network_id;
|
||||
wp_update_network_site_counts( self::$different_network_id );
|
||||
|
||||
$site_count = get_blog_count( self::$different_network_id );
|
||||
|
||||
@@ -209,25 +200,13 @@ class Tests_Multisite_Network extends WP_UnitTestCase {
|
||||
* @ticket 37866
|
||||
*/
|
||||
public function test_get_user_count_on_different_network() {
|
||||
global $current_site, $wpdb;
|
||||
|
||||
wp_update_network_user_counts();
|
||||
$current_network_user_count = get_user_count();
|
||||
|
||||
// switch_to_network()...
|
||||
$orig_network_id = $current_site->id;
|
||||
$orig_wpdb_network_id = $wpdb->siteid;
|
||||
$current_site->id = self::$different_network_id;
|
||||
$wpdb->siteid = self::$different_network_id;
|
||||
|
||||
// Add another user to fake the network user count to be different.
|
||||
wpmu_create_user( 'user', 'pass', 'email' );
|
||||
|
||||
wp_update_network_user_counts();
|
||||
|
||||
// restore_current_network()...
|
||||
$current_site->id = $orig_network_id;
|
||||
$wpdb->siteid = $orig_wpdb_network_id;
|
||||
wp_update_network_user_counts( self::$different_network_id );
|
||||
|
||||
$user_count = get_user_count( self::$different_network_id );
|
||||
|
||||
|
||||
@@ -148,8 +148,8 @@ class Tests_Multisite_Option extends WP_UnitTestCase {
|
||||
* @group multisite
|
||||
*/
|
||||
function test_site_notoptions() {
|
||||
global $wpdb;
|
||||
$notoptions_key = "{$wpdb->siteid}:notoptions";
|
||||
$network_id = get_current_network_id();
|
||||
$notoptions_key = "{$network_id}:notoptions";
|
||||
|
||||
$_notoptions = wp_cache_get( 'notoptions', 'site-options' );
|
||||
$this->assertEmpty( $_notoptions );
|
||||
|
||||
Reference in New Issue
Block a user