WordPress at Your Fingertips
function is not described

WP_Date_Query::get_sql() public WP 3.7.0

Generate WHERE clause to be appended to a main query.

{} It's a method of the class: WP_Date_Query{}

Hooks from the method

String. MySQL WHERE clause.


$WP_Date_Query = new WP_Date_Query();


Since 3.7.0 Introduced.

Code of WP_Date_Query::get_sql() WP 5.8

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 $this  The WP_Date_Query instance.
	return apply_filters( 'get_date_sql', $where, $this );