[wp-trac] [WordPress Trac] #34266: Support for ranges in WP_Query

WordPress Trac noreply at wordpress.org
Mon Oct 12 18:19:49 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:  trunk
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by dziudek):

 @akibjorklund - in fact it is a syntax sugar for WP_Query, but in my
 opinion very useful - instead of writing nested arrays with clauses you
 can put it inside one simple string.

 Regarding the use cases:
 * when you have a page with a lot of posts it is easier to specify the
 start/end ID than full date of post (with hours and minutes)
 * it is a good replacement for case when we have lot of IDs in the
 post__in - it means less code,
 * show posts which have ID higher/lower than X - it means a lot of less
 code than using date conditionals with syntax like {{{'0..123'}}} or
 {{{'123..1000000'}}}
 * show posts from specific time range in an easy way like {{{'post_date'
 => '2015-01-01..2015-10-01'}}}

 And please remember - I don't want to replace some features - just add
 simpler syntax for it :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34266#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list