WP_Date_Query::get_sql(): string

In this article

Generates WHERE clause to be appended to a main query.

Return

string MySQL WHERE clause.

Source

public function get_sql() {
	$sql = $this->get_sql_clauses();

	$where = $sql['where'];

	/**
	 * Filters the date query WHERE clause.
	 *
	 * @since 3.7.0
	 *
	 * @param string        $where WHERE clause of the date query.
	 * @param WP_Date_Query $query The WP_Date_Query instance.
	 */
	return apply_filters( 'get_date_sql', $where, $this );
}

Hooks

apply_filters( ‘get_date_sql’, string $where, WP_Date_Query $query )

Filters the date query WHERE clause.

Changelog

VersionDescription
3.7.0Introduced.

User Contributed Notes

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