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

WordPress Trac noreply at wordpress.org
Tue Oct 13 16:14:35 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 akibjorklund):

 Makes sense. The nested arrays really can get pretty complex to write and
 not so easy to read and anything that will make it simpler could
 potentially a good thing.

 For IDs though, you can just use the `range` function in PHP and I think
 it will look even better than concatenating strings. I know it is not
 exactly the same, but for most cases effectively it is.

 It is a bit unfortunate that PHP does not have a language construct for
 ranges. Concatenating (or formatting) strings does not look that much
 better, at least to me.

 And surely there are other ways we could make writing readable queries
 easier too. A collection of very descriptive helper functions that return
 arrays could for example be one and also a more extendable model for
 achieving that goal.

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


More information about the wp-trac mailing list