From d9a28a3197c9e20a74ccf9fb5275b99d68d6ab12 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Thu, 9 Jun 2016 18:10:29 +0000 Subject: [PATCH] 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 --- wp-includes/ms-deprecated.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index f45896ed4f..998f04ad81 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index c9278c0b30..51560b3cd5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.