[wp-trac] [WordPress Trac] #29822: Support complex queries in WP_Date_Query
WordPress Trac
noreply at wordpress.org
Wed Oct 1 23:55:52 UTC 2014
#29822: Support complex queries in WP_Date_Query
--------------------------+-----------------
Reporter: boonebgorges | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 4.1
Component: Date/Time | Version:
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------
Sister tickets: #29642 (`WP_Meta_Query`) and #29738 (`WP_Tax_Query`).
`WP_Date_Query` currently supports one level of relation between
subqueries, so you can ask for something like 'items from 2011 OR items
from 2010' or 'items published in 2010 AND on a Thursday'. But, excepting
some clever manipulation of `IN` clauses, it's not possible to get any
more complex than this.
I propose to update `WP_Date_Query` to support arbitrarily nested queries,
which will support mixed relations.
Using the `WP_Recursive_Query` structure in #29642 will automatically mean
another added feature: the ability to construct a date query across
multiple columns. So you'll be able to make a request like 'items with
post_date between 2010 and 2012 AND post_modified > 2013'. Cross-table
support will be the next logical step but is a bit complex to include in
this ticket; I'll open a separate one for that feature.
See #29781 for the unit tests that will support this refactoring.
I'll have an initial patch for review within a couple days.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/29822>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list