[wp-trac] [WordPress Trac] #34266: Support for ranges in WP_Query
WordPress Trac
noreply at wordpress.org
Tue Oct 13 16:58:51 UTC 2015
#34266: Support for ranges in WP_Query
-----------------------------+------------------------------
Reporter: dziudek | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Resolution:
Keywords: 2nd-opinion | Focuses:
-----------------------------+------------------------------
Changes (by johnbillion):
* keywords: => 2nd-opinion
* version: trunk =>
Comment:
While this might just be syntactical sugar, I think it has **very**
limited use outside of date ranges. How often do you need to query for
post IDs within a given range? What are the real life use cases for
querying for a range of post IDs, bearing in mind that the range probably
needs to be computed prior to the actual query.
Querying for posts that fall within a certain date range is, as mentioned
above, much more common, but this can still be achieved with quite a
concise syntax:
{{{
new WP_Query( array(
'date_query' => array(
array(
'after' => '2015-01-01',
'before' => date( 'Y-m-d' ),
),
),
) );
}}}
I'd like to see some more real world examples before I'm completely
convinced.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34266#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list