From e0ef4132fe064aa8af357c230678da1b654ff705 Mon Sep 17 00:00:00 2001 From: jeremyfelt Date: Tue, 20 Sep 2016 17:48:42 +0000 Subject: [PATCH] Multisite: Provide `$join` as a possible SQL clause to the `sites_clauses` filter. Previously, `compact()` provided a non existent `$join` and could cause confusion for anyone attempting to extend `WP_Site_Query` with their own tables. This aligns with the current behavior in `WP_Network_Query`. Props johnjamesjacoby. Fixes #37922. git-svn-id: https://develop.svn.wordpress.org/trunk@38631 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-site-query.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/class-wp-site-query.php b/src/wp-includes/class-wp-site-query.php index b19b8f205e..cedc9c5e2e 100644 --- a/src/wp-includes/class-wp-site-query.php +++ b/src/wp-includes/class-wp-site-query.php @@ -514,6 +514,8 @@ class WP_Site_Query { $this->sql_clauses['where']['date_query'] = preg_replace( '/^\s*AND\s*/', '', $this->date_query->get_sql() ); } + $join = ''; + $where = implode( ' AND ', $this->sql_clauses['where'] ); $pieces = array( 'fields', 'join', 'where', 'orderby', 'limits', 'groupby' );