[wp-trac] [WordPress Trac] #36701: Pages parameter for get_comments

WordPress Trac noreply at wordpress.org
Thu Apr 28 14:41:57 UTC 2016


#36701: Pages parameter for get_comments
------------------------------------------+-----------------------------
 Reporter:  mireillesan                   |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Comments                      |     Version:  4.5.1
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:   => needs-patch needs-unit-tests
 * milestone:  Awaiting Review => Future Release


Comment:

 Hi @mireillesan - Thanks for the ticket, and welcome to WordPress Trac!

 Pagination parameters seem like a good idea. The parameter name for the
 page number, based on what we use in other query classes, would be
 `paged`. We are less consistent about the "per page" parameter name -
 `WP_Query` calls it `posts_per_page`, while `WP_User_Query` calls it
 `number`. Since we already have `number` in `WP_Comment_Query`, it makes
 sense to use it here too.

 When introducing new parameters like this, which are conceptually similar
 to other existing params (in this case, `offset`), we should have unit
 tests that demonstrate which one takes precedence - ie, what happens when
 you pass `offset=21&paged=5&number=20`.

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


More information about the wp-trac mailing list