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:
parent
1f90e1d7bb
commit
d9a28a3197
|
@ -506,7 +506,8 @@ function wp_get_sites( $args = array() ) {
|
||||||
$results = array();
|
$results = array();
|
||||||
|
|
||||||
foreach ( $_sites as $_site ) {
|
foreach ( $_sites as $_site ) {
|
||||||
$results[] = (array) get_site( $_site );
|
$_site = get_site( $_site );
|
||||||
|
$results[] = $_site->to_array();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue