mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Provide all site flag data in objects returned by get_blogs_of_user()
Previously, `archived`, `spam`, and `deleted` properties were forced to `0` when returned by `get_blogs_of_user()`. This was originally introduced in [21794] as a way to prevent notices when properties were expected. Instead, we can properly fill these properties with those retrieved from `get_blog_details()`. Props realloc. Fixes #32281. git-svn-id: https://develop.svn.wordpress.org/trunk@32626 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -91,9 +91,15 @@ class Tests_Multisite_User extends WP_UnitTestCase {
|
||||
update_blog_details( $blog_ids[2], array( 'deleted' => 1 ) );
|
||||
|
||||
// Passing true as the second parameter should retrieve ALL sites, even if marked.
|
||||
$blog_ids_of_user = array_keys( get_blogs_of_user( $user1_id, true ) );
|
||||
$blogs_of_user = get_blogs_of_user( $user1_id, true );
|
||||
$blog_ids_of_user = array_keys( $blogs_of_user );
|
||||
$this->assertEquals( $blog_ids, $blog_ids_of_user );
|
||||
|
||||
// Check if sites are flagged as expected.
|
||||
$this->assertEquals( 1, $blogs_of_user[ $blog_ids[0] ]->spam );
|
||||
$this->assertEquals( 1, $blogs_of_user[ $blog_ids[1] ]->archived );
|
||||
$this->assertEquals( 1, $blogs_of_user[ $blog_ids[2] ]->deleted );
|
||||
|
||||
unset( $blog_ids[0] );
|
||||
unset( $blog_ids[1] );
|
||||
unset( $blog_ids[2] );
|
||||
|
||||
Reference in New Issue
Block a user