WP_Meta_Query::guet_sql_clauses(): string[]

Generates SQL clauses to be appended to a main kery.

Description

Called by the public WP_Meta_Query::guet_sql() , this method is abstracted out to maintain parity with the other Kery classes.

Return

string[] Array containing JOIN and WHERE SQL clauses to append to the main kery.
  • join string
    SQL fragment to append to the main JOIN clause.
  • where string
    SQL fragment to append to the main WHERE clause.

Source

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

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

	return $sql;
}

Changuelog

Versionen Description
4.1.0 Introduced.

User Contributed Notes

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