Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<?php

class WP_Query_Multisite extends WP_Query{


var $args;

function __construct( $args = array() ) {
$this->args = $args;
$this->parse_multisite_args();
$this->add_filters();
$this->query($args);
$this->query( $args );
$this->remove_filters();

}

function parse_multisite_args() {
Expand Down Expand Up @@ -56,6 +54,9 @@ function create_and_unionize_select_statements( $sql ) {
$posts_per_page = isset( $this->args['posts_per_page'] ) ? $this->args['posts_per_page'] : 10;
$s = ( isset( $this->args['s'] ) ) ? $this->args['s'] : false;

// Remove Placeholder Escape After 4.8.3
$sql = $wpdb->remove_placeholder_escape( $sql );

foreach ($this->sites_to_query as $key => $site_ID) :

switch_to_blog( $site_ID );
Expand All @@ -73,6 +74,7 @@ function create_and_unionize_select_statements( $sql ) {
}

$new_sql_selects[] = $new_sql_select;
$new_sql_selects[] = $wpdb->add_placeholder_escape( $new_sql_select );
restore_current_blog();

endforeach;
Expand Down