Generate SQL clauses to be appended to a main query.

Description Description

Called by the public BP_XProfile_Query::get_sql(), this method is abstracted out to maintain parity with WP’s Query classes.

Top ↑

Return Return

(array) Array containing JOIN and WHERE SQL clauses to append to the main query.

  • 'join'
    (string) SQL fragment to append to the main JOIN clause.
  • 'where'
    (string) SQL fragment to append to the main WHERE clause.

Source Source

File: bp-xprofile/classes/class-bp-xprofile-query.php

	protected function get_sql_clauses() {
		 * $queries are passed by reference to get_sql_for_query() for recursion.
		 * To keep $this->queries unaltered, pass a copy.
		$queries = $this->queries;
		$sql = $this->get_sql_for_query( $queries );

		if ( ! empty( $sql['where'] ) ) {
			$sql['where'] = ' AND ' . $sql['where'];

		return $sql;

Top ↑

Changelog Changelog

Version Description
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.