Skip to content

Commit

Permalink
Set proper query default args for site_id
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Apr 22, 2014
1 parent b56b238 commit 2e5a56d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions includes/query.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ),
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 2e5a56d

Please sign in to comment.