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.


Top ↑

Parameters

$query

(array)(Required)Date query arguments.


Top ↑

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.


Top ↑

Source

File: wp-includes/class-wp-date-query.php

	protected function get_sql_for_subquery( $query ) {
		return $this->get_sql_for_clause( $query, '' );
	}


Top ↑

Changelog

Changelog
VersionDescription
3.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.