Multisite: Use `to_array()` method on `WP_Site` objects in `wp_get_sites()`

When an object with private properties is cast directly to an array, those properties are no longer available with their original keys.

Props @flixos90.
See #36717.

Built from https://develop.svn.wordpress.org/trunk@37667


git-svn-id: http://core.svn.wordpress.org/trunk@37633 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2016-06-09 18:10:29 +00:00
parent 1f90e1d7bb
commit d9a28a3197
2 changed files with 3 additions and 2 deletions

View File

@ -506,7 +506,8 @@ function wp_get_sites( $args = array() ) {
$results = array();
foreach ( $_sites as $_site ) {
$results[] = (array) get_site( $_site );
$_site = get_site( $_site );
$results[] = $_site->to_array();
}
return $results;

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6-alpha-37666';
$wp_version = '4.6-alpha-37667';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.