Skip to content
Permalink
Browse files

Change sites arrays to WP_Site objects

  • Loading branch information...
Luke Carbis
Luke Carbis committed Jun 14, 2016
1 parent 6046871 commit cfab0413e67b83d969bd6612c895ecdb05dbfce4
Showing with 8 additions and 5 deletions.
  1. +2 −2 classes/class-network.php
  2. +1 −1 classes/class-uninstall.php
  3. +1 −1 connectors/class-connector-blogs.php
  4. +4 −1 includes/functions.php
@@ -395,9 +395,9 @@ public function list_table_filters( $filters ) {
// add all sites
foreach ( wp_stream_get_sites() as $blog ) {
$blog_data = get_blog_details( $blog );
$blog_data = get_blog_details( $blog->blog_id );
$blogs[ $blog['blog_id'] ] = array(
$blogs[ $blog->blog_id ] = array(
'label' => $blog_data->blogname,
'disabled' => '',
);
@@ -137,7 +137,7 @@ private function delete_all_options() {
// Delete options from each blog on network
foreach ( wp_stream_get_sites() as $blog ) {
$this->delete_blog_options( absint( $blog['blog_id'] ) );
$this->delete_blog_options( absint( $blog->blog_id ) );
}
}
@@ -66,7 +66,7 @@ public function get_context_labels() {
$blogs = wp_stream_get_sites();
foreach ( $blogs as $blog ) {
$blog_details = get_blog_details( $blog['blog_id'] );
$blog_details = get_blog_details( $blog->blog_id );
$key = sanitize_key( $blog_details->blogname );
$labels[ $key ] = $blog_details->blogname;
}
@@ -95,7 +95,10 @@ function wp_stream_get_sites() {
if ( function_exists( 'get_sites' ) ) {
$sites = get_sites();
} else {
$sites = wp_get_sites();
$sites = array();
foreach ( wp_get_sites() as $site ) {
$sites = get_site( $site['blog_id'] );
}
}
return $sites;

0 comments on commit cfab041

Please sign in to comment.
You can’t perform that action at this time.