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
Return
String. MySQL WHERE clause.
Usage
$WP_Date_Query = new WP_Date_Query(); $WP_Date_Query->get_sql();
Changelog
Since 3.7.0 | Introduced. |
Code of WP_Date_Query::get_sql() WP Date Query::get sql WP 5.6
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 );
}