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
This commit is contained in:
jeremyfelt 2016-09-20 17:48:42 +00:00
parent 9bb6bd0f89
commit e0ef4132fe

View File

@ -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' );