Make WordPress Core


Ignore:
Timestamp:
06/09/2016 06:09:25 PM (9 years ago)
Author:
jeremyfelt
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/ms-deprecated.php

    r37653 r37667  
    507507
    508508    foreach ( $_sites as $_site ) {
    509         $results[] = (array) get_site( $_site );
     509        $_site = get_site( $_site );
     510        $results[] = $_site->to_array();
    510511    }
    511512
Note: See TracChangeset for help on using the changeset viewer.