diff --git a/includes/query.php b/includes/query.php index fe2a83445..caed6ff24 100755 --- a/includes/query.php +++ b/includes/query.php @@ -22,8 +22,6 @@ public static function get_instance() { public function query( $args ) { global $wpdb; - $site_id = is_multisite() ? get_current_site()->id : 1; - $defaults = array( // Pagination params 'records_per_page' => get_option( 'posts_per_page' ), @@ -34,7 +32,7 @@ public function query( $args ) { 'type' => 'stream', 'object_id' => null, 'ip' => null, - 'site_id' => is_network_admin() ? null : $site_id, + 'site_id' => is_multisite() ? get_current_site()->id : 1, 'blog_id' => is_network_admin() ? null : get_current_blog_id(), // Author params 'author' => null, @@ -276,7 +274,7 @@ public function query( $args ) { */ $order = esc_sql( $args['order'] ); $orderby = esc_sql( $args['orderby'] ); - $orderable = array( 'ID', 'site_id', 'object_id', 'author', 'author_role', 'summary', 'visibility', 'parent', 'type', 'created' ); + $orderable = array( 'ID', 'site_id', 'blog_id', 'object_id', 'author', 'author_role', 'summary', 'visibility', 'parent', 'type', 'created' ); if ( in_array( $orderby, $orderable ) ) { $orderby = $wpdb->stream . '.' . $orderby;