[wp-trac] [WordPress Trac] #42947: REST API wrong total pages

WordPress Trac noreply at wordpress.org
Thu Mar 22 18:09:21 UTC 2018


#42947: REST API wrong total pages
-----------------------------+------------------------------
 Reporter:  elvishp2006      |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  REST API         |     Version:  4.9.1
 Severity:  normal           |  Resolution:
 Keywords:  has-screenshots  |     Focuses:  rest-api
-----------------------------+------------------------------

Comment (by schlessera):

 To make this work, I think WP would need to make two separate queries when
 checking for draft posts and published posts at the same time.

 So, the logic would be:

 If status includes `draft`:
  - remove `draft` from status and run query
  - run second query for `draft` status where the `author` is the current
 user
  - sum the count of both queries

 @timothyblynjacobs mentioned that this might not work as expected due to
 capability checks, though.

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


More information about the wp-trac mailing list