[wp-trac] [WordPress Trac] #51677: Limit param not consistent between object query classes.

WordPress Trac noreply at wordpress.org
Fri Oct 30 10:38:46 UTC 2020


#51677: Limit param not consistent between object query classes.
--------------------------+-----------------------------
 Reporter:  keraweb       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Query         |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When querying without limit for posts (`posts_per_page` param) you pass
 `-1` as the limit parameter.
 If you want to do the same for terms (`number` param) you need to pass
 `0`.
 These two options are apparently not both valid in both cases.

 For consistency I'd say both `-1` and `0` should be valid as a "no limit"
 query parameter in all cases.
 Or at least the `WP_Term_Query` class should also accept `-1` as the
 limiting param.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51677>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list