WP_Date_Query::get_sql()publicWP 3.7.0

Generates WHERE clause to be appended to a main query.

Method of the class: WP_Date_Query{}

Hooks from the method

Return

String. MySQL WHERE clause.

Usage

$WP_Date_Query = new WP_Date_Query();
$WP_Date_Query->get_sql();

Changelog

Since 3.7.0 Introduced.

WP_Date_Query::get_sql() code WP 6.4.3

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 );
}