WP_Date_Query::get_sql_for_subquery() WordPress Method
The WP_Date_Query::get_sql_for_subquery() method is used to return a portion of an SQL statement that can be used to query a WordPress database for posts within a specified date range. This method is used internally by the WP_Date_Query class when generating SQL queries.
WP_Date_Query::get_sql_for_subquery( array $query ) #
Turns a single date clause into pieces for a WHERE clause.
Description
A wrapper for get_sql_for_clause(), included here for backward compatibility while retaining the naming convention across Query classes.
Parameters
- $query
(array)(Required)Date query arguments.
Return
(string[]) Array containing JOIN and WHERE SQL clauses to append to the main query.
- 'join'
(string) SQL fragment to append to the main JOIN clause. - 'where'
(string) SQL fragment to append to the main WHERE clause.
Source
File: wp-includes/class-wp-date-query.php
protected function get_sql_for_subquery( $query ) { return $this->get_sql_for_clause( $query, '' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.7.0 | Introduced. |