From 02c8bd1909c9138ca130b2530b8f6f0f6cf4236a Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Tue, 20 Sep 2016 17:49:28 +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. Built from https://develop.svn.wordpress.org/trunk@38631 git-svn-id: http://core.svn.wordpress.org/trunk@38574 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-site-query.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/class-wp-site-query.php b/wp-includes/class-wp-site-query.php index b19b8f205e..cedc9c5e2e 100644 --- a/wp-includes/class-wp-site-query.php +++ b/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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index c229e446a0..592e879b0b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38630'; +$wp_version = '4.7-alpha-38631'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.